Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

3 Answers

up vote 4 down vote accepted

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:

puppet apply --modulepath /root/modules file.pp

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.

share|improve this answer
    
Thanks. The question was effectively, how do I do that. It turns out that Vagrant mounts the modules such that you can cd /tmp/vagrant-puppet puppet apply --modulepath ./modules-0 manifests/site.pp –  slim Jul 3 '12 at 15:21
add comment

I would recommend installing sahara. Then your workflow becomes:

vagrant up
vagrant sandbox on
vagrant ssh
*do some stuff that doesn't work
vagrant sandbox rollback
vagrant ssh
* do some stuff that does work
vagrant sandbox commit

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)

share|improve this answer
add comment

You can also re-apply manifest changes by running

vagrant provision

So your workflow becomes

vagrant up
while(not working as desired) {
 amend manifest
 vagrant provision
}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.