Package: vagrantgen
VagrantgenVagrantgen is a simply CLI to generate Vagrantfiles from a standard YAML.This is a YAML example:- projectname: cluster1
  provider: virtualbox
  vms:
  - name: vm01
    box: rockylinux/8
    mem: 1024
    cpu: 2And this the Vagrantfile generated:Vagrant.configure("2")do|config|config.vm.synced_folder".","/vagrant",disabled:trueconfig.vm.define"cluster1vm01"do|node|node.vm.hostname="cluster1vm01"node.vm.box="rockylinux/8"node.vm.provider"virtualbox"do|provider|provider.memory="1024"provider.cpus="2"endendendHow use the CLIIf you runvagrantgen -h, then you find the help menu:$vagrantgen-h

usage:vagrantgen[-h]{template,vf,ai}...

VagrantfileGenerator-github.com/aramcap/vagrantgen

positionalarguments:{template,vf,ai}SubcommandstemplateGeneratetemplatevfGenerateVagrantfileaiGenerateansible-inventoryfilefrom"vagrant ssh-config"commandoptionalarguments:-h,--helpshowthishelpmessageandexitAny menu has--helpcommand available.vagrantgen template: Generates a template to facilitate the use.vagrantgen vf: Generates a Vagrantfile from a template file.With argument-iyou can specify a filename (by defaultvagrant-template.yaml).With argument-othe output is in stdout.With argument-fthe output file is overwriten if exists.vagrantgen ai: Generates a Ansible inventory file fromvagrant ssh-configcommand.With argument-othe output is in stdout.With argument-fthe output file is overwriten if exists.Another examples- projectname: cluster1
  provider: libvirt # libvirt or virtualbox or docker
  vms:
  - name: vm01
    box: rockylinux/8
    mem: 1024
    cpu: 2
    disks:
    - name: disk1.qcow2
      size: 10G
    net:
    - network: private_network
      ip: 192.168.122.100
    provision:
    - provisioner: ansible
      payload: "playbook.yml"- projectname: cluster1
  provider: docker # libvirt or virtualbox or docker
  vms:
  - name: vm01
    box: centos-sshDocker provider not support net tag (ports is optional tag):- projectname: cluster1
  provider: docker # libvirt or virtualbox or docker
  vms:
  - name: vm01
    box: centos-ssh
    ports:
      - "10023:23"Example with provision (optional tag):- projectname: cluster1
  provider: docker # libvirt or virtualbox or docker
  vms:
  - name: vm01
    box: centos-ssh
    provision:
    - provisioner: shell-inline # shell-inline, shell-external, ansible
      payload: "echo Hello > /home/vagrant/hello; chown vagrant:vagrant /home/vagrant/hello"- projectname: cluster1
  provider: docker # libvirt or virtualbox or docker
  vms:
  - name: vm01
    box: centos-ssh
    provision:
    - provisioner: ansible # shell-inline, shell-external, ansible
      payload: "playbook.yml"Libvirt or Virtualbox providers not support ports tag:- projectname: cluster1
  provider: virtualbox # libvirt or virtualbox or docker
  vms:
  - name: vm01
    box: centos/7
    mem: 1024
    cpu: 2Example with network (optional tag):- projectname: cluster1
  provider: virtualbox # libvirt or virtualbox or docker
  vms:
  - name: vm01
    box: centos/7
    mem: 1024
    cpu: 2
    disks:
    - name: disk1.vdi
      size: 20 # GBs
    net:
    - network: private_network
      ip: 192.168.122.100
    - network: public_network
      dev: br01
    - network: forwarded_port
      guest: 80
      host: 8080
      host_ip: 127.0.0.1ColaborateIf do you want to colaborate, you can make a pull-request onhttps://github.com/aramcap/vagrantgen.LicenseGNU AFFERO GENERAL PUBLIC LICENSE version 3