Vagrant configuration that includes a (quickly hacked together) dynamic inventory script, vagrant vm definition helper and a hosts generator. This enables bringing up a development duplicate of any host in the production inventory with Vagrant and keeps the same locally defined IPs that can also be written to /etc/hosts if needed. Requires the ansible inventory to be in YAML format.
- Install jinja2 version 2.8, newer versions have still bugs in ansible.
pip install jinja2=2.8 --user
- Install ansible version 2.7
pip install ansible==2.7 --user
- Symlink playbooks
ln -s /path/to/playbooks playbooks
- Configure ansible-vault password path (vault_password_file) in ansible.cfg.
Vagrant is ready to run, see a list of configured boxes
with vagrant status
. IPs will be assigned on first run (in ip_mapping.json).
Optionally generate a hosts file with ./inventory.rb --hosts
. If using this, keep hosts.base up
to date.