- You need Vagrant, Virtualbox and Ansible
- Clone the repo
cd
into the repo you just clonedvagrant up
- ...wait...
ansible-playbook site.yml -i env/staging/inventory
- Check the output, read the debug message
ansible-playbook site.yml -i env/production/inventory
- Check the output, read the debug message
- SHAZAM! Multi-environment setup where you scripts don't need to know anything about the environment they are running in
vagrant destroy
BEWARE Repeated runs require you to remove the host entry from $HOME/.ssh/known_hosts
See also https://github.com/JGailor/ansible-example-multi-env