This project is an example for using Debops with Vagrant. It uses the Vagrant provisioner plugin Vai to generate the inventory-file. Provision is then actually done using debops as usual.
The Vagrant Ansible provisioner is not used at all, because Vai does a much better job for our needs. If you absolutely want to use the Vagrant Ansible provisioner, please have a look at the vagrant-multi-machine example.
- Ansible
- Vagrant 1.6 or newer (1.5 may work, too; 1.4 does not)
- Vai, a Vagrant provisioner plugin (see below for installation)
- debops (of course ;-)
Incomplete
Install the Vagrant provisioning plugin Vai:
vagrant plugin install vai
Fire up Vagrant:
vagrant up
This will create two virtual machine web and db and generate the inventory file in
ansible/inventory
.Run:
ANSIBLE_SSH_ARGS="-o UserKnownHostsFile=/dev/null" debops ./simpletest.yml
This will run a simple playbook testing if files have been found and variables have been set up as correctly as expected. You should get "okay" for all tasks.
Please note: Using this
ANSIBLE_SSH_ARGS=...
is optional. But it avoids cluttering your known_hosts with keys of your ever-changing vagrant VMs. Absolutely do not use this for your production servers!
Now you can use debops as usual (mind ANSIBLE_SSH_ARGS=...
:-). It
will automatically include the host definitions auto-generated by
vagrant. If for some reason debops resp. Ansible does not find the
inventory, you may safely run vagrant provision
to regenerate it.
Please refer to the vagrant-multi-machine example for more about this.