I have three virtual machine that I have created using Vagrant. This virtual machine have as box ubuntu/trusty64. I have created all VMs in the same Vagrantfile as single project. To provision it, I have used Puppet. For now, the three vms use different manifests. I want to automate this process, when the manifests change. So, if I add one package to one manifest I want that without my intervention, vagrant detect that and re-provision VMs according with new changes in manifests files.
I'm very newbie in Vagrant and more in Puppet, for that, my question is:
¿is that possible?
This is the project that I am developing: https://github.com/jngd/puppet-tfg
Vagrant itself isn't going to be able to do this. What you'll need is something like guard to watch the manifests and do "something" when they change. I wouldn't recommend completely reprovisioning the VM (
vagrant destroy; vagrant up
) on every change, because that way lies madness (it'll take a lot longer to run that it'll take you to make more edits), but runningvagrant ssh sudo puppet apply /etc/puppet
is certainly feasible.I am not a Puppet user, but a CFEngine veteran. I did see that Puppet has an agent - puppet-agent that (can) periodically pull updated manifests from the Puppet master much like cf-agent/cf-execd does with promise bundles in CFE.
I'd say that if you configure puppet-agent to run every 10 minutes or so, it should pull down the latest changes and run, updating your VMs. I don't know how Puppet handles packages (RPM? deb?) management, but I'm sure that if your manifest says to install a list of packages, adding one to the list should invoke a package install, along with all the other provisioning directives - copy files, manage services, etc.
I'm guessing you could run puppet-agent as a daemon, or as a cron job.
The catch is - you have to be able to reach your Puppet master from the Vagrant systems, so they will not update unless you're connected to your VPN/network and can reach the master.