This Vagrant plugin allow provisioning your VM with ansible playbooks directly from the guest VM using --connection=local
install this vagrant plugin by running
vagrant plugin install vagrant-ansible-local
Your vagrant box should have ansible installed on it, if it's not the case you could use to shell provisioner to install it.
Configure your VagrantFile with the ansibleLocal
provisioner:
config.vm.provision :ansibleLocal, :playbook => "ansible/ansible.yml"
In case your ansible version is between 1.5 and 1.8 and you are running into an error message saying ERROR: provided hosts list is empty
, you can either add anything to your /etc/ansible/hosts
file or change the configuration of the provisioner:
config.vm.provision :ansibleLocal, :playbook => "playbooks/playbook.yml", :raw_arguments => "-i 'localhost,'"
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)inventory-file
and prevent issue with non executable file mounted with 777