I'm using vagrant and ansible to provision a virtual machine and that works fine. The ansible playbook clones a git repo, installs it and runs a service daemon.
I'd also like to have a vagrant command that executes a separate "update" playbook that pulls the latest from the git repo, installs and restarts the daemon.
Something like this usage would be nice.
Vagrant.configure("2") do |config|
# Default
config.vm.provision "ansible" do |ansible|
ansible.playbook = "playbook.yml"
end
# Update
config.vm.provision "ansible", name="update" do |ansible|
ansible.playbook = "update.yml"
end
end
Then I could run it with vagrant --provision-with update
. Is something like this possible? I'd like to avoid having to ssh into the box to run an update like this.