Skip to content

A multi-machine Vagrantfile that reads guest definitions from an Ansible inventory.

Notifications You must be signed in to change notification settings

pgsocks/vagrant-generic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

This is a master Vagrantfile for generalizing multi-machine projects by using host variables in an Ansible inventory to create Vagrant hosts. It only works for the libvirt provider currently. This is useful for quickly testing Ansible roles and playbooks.

The idea for this project was inspired by Bert Van Vreckem's One Vagrantfile to rule them all

Dependencies

  • Vagrant
  • Vagrant Libvirt provider
  • Libvirt

Usage

In the Ansible inventory, add the following to each host's variables. Anything without a default value is mandatory.

name type description default
vagrant_box String Name of the Vagrant box
vagrant_box_url String URL of the Vagrant box omit
vagrant_memory Integer Amount of memeory in MiB 2048
vagrant_cpus Integer Number of CPUs 2

NOTE: If the inventory is not in a standard location, then it will need to be specified in an ansible.cfg file along with the Vagrantfile.


With the inventory complete, simply use vagrant up.

About

A multi-machine Vagrantfile that reads guest definitions from an Ansible inventory.

Topics

Resources

Stars

Watchers

Forks