Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

heitorlessa/vagrant-multiple-vms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

3 Commits

Repository files navigation

Multiple VMs with Vagrant

This is a simple yet flexible Vagrantfile that parses a .yml file (servers.yml) in this example, where you should be able to pass the following:

  • name: VM Name
  • box: Vagrant box (i.e hashicorp/precise32)
  • ram: Amount of memory you want to assign to this box
  • ip: defines if public network will be used, it accepts 'dhcp' or 'i.p.addr.ess'
  • playbook: path to Ansible playbook to use as a provisioner

Credits

Full credits to Scott where I 'hacked' the code from.

Installation

Make sure you already have Vagrant installed, then format 'servers.yml' as following and ensure Vagrantfile is sitting alongside with this YAML file:

- name: nodejs
box: hashicorp/precise32
ram: 128
ip: dhcp
# playbook: "provisioning/vagrant/vagrant_server.yml"
# - name: openvpn-client01
# box: hashicorp/precise32
# ram: 128
# playbook: "provisioning/vagrant/vagrant_client.yml"
# ip: 172.16.100.14

Note that '#' still applies as comments. The above will create a Vagrant VM called 'nodejs' with the above requirements and will ask what adapter you want to use for the public_network

Vagrant official reference:

Development

Can't find Chef or Puppet or another particular option (Port forward)?? Great!

Feel free to contribute by either forking or PR :)

License

MIT

About

Vagrantfile that handles multiple VMs easily

Resources

Readme

License

MIT license

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published