Host are provisioned with Ansible.
Virtual machine are created either with VirtualBox
or with QEMU. Please see rebuild-all
script for that. That script uses QEMU.
Please see Vagrant documentation for details how to use it. The quick tutorial is as follows:
vagrant up
- starts all virtual machines, provision them if necessaryvagrant provision
- provision already created virtual machines again - in this case it would be Ansible playbook inprovisioning/site.yml
vagrant halt
- stop all created virtual machines
After Vagrant installs machines the first time it will spin up much faster the next time.
Once the virtual machines are up, you connect to with vagrant ssh ex01
, etc, command.
Once the system is fully started, you connect to with:
http://ex01.multihostexample.dev
http://ex02.multihostexample.dev
http://ex03.multihostexample.dev
http://ex04.multihostexample.dev
- VirtualBox >= 4.3.26 or QEMU, ideally with KVM
- Ansible >= 1.9.0
- Vagrant >= 1.7.0
Virtualbox binaries are available at its download page and follow the instruction there.
QEMU is available as Linux packages in the modern distributions.
Vagrant needs Vagrant Libvirt Provider - this can be installed with vagrant plugin install vagrant-libvirt
Please follow installation instructions in the Ansible documentation.
Please note: as there isn't Ansible implementation for MS Windows, this example won't start Ansible provisioner on that platform.
Installing Vagrant is extremely easy. Head over to the downloads page and get the appropriate installer or package for your platform. Then install it using standard procedures for your operating system.
The installer will automatically add vagrant to your system path so that it is available in terminals. If it is not found, please try logging out and logging back in to your system (this is particularly necessary sometimes for Windows).
taken from https://docs.vagrantup.com/v2/installation/index.html
############################
vagrant plugin install vagrant-hostmanager
#!shell
vagrant up
#!shell
ansible-galaxy install -r requirements.yml
vagrant provision
#!shell
./run-ansible-vagrant.sh provisioning/site.yml