I'm new to puppet and vagrant, but I'm developing my own Puppet manifests intended to set up a vagrant box. That is, the puppet manifest is in my Vagrant directory on the host machine, and vagrant is invoking puppet -- there is no puppet server.
The thing is, my workflow is:
while(not working as desired) {
vagrant destroy
amend manifest
vagrant up
}
... and this means quite a lot of waiting around.
What's a better way to work?
You can also re-apply manifest changes by running
So your workflow becomes
Why do you keep recreating the vm? Why not ssh into it, and work on the manifest until it works?
By the way,
puppet parser validate
is a good way of catching primary errors before even testing what puppet is doing.Personally, I go to a clean VM, or a VM that is a copy of whatever I want to change, copy any required modules to there under
/root/modules
, create a new module, and then run this:Where
file.pp
includes anything necessary, and my module is inside a subdirectory of/root/modules
, in the standard module configuration.Now, there are situations where creating the vm is fundamental, such as doing the initial configuration, or validating the configuration you have so far. But I see no reason to do all the work on a newly created vm all the time.
I would recommend installing sahara. Then your workflow becomes:
I prefer rather than doing the commit you do a rollback and then add what ever you changed to your preferred provisioning scripts (puppet,chef, ssh etc)