Question

We are working on chef recipe that builds PHP from source. However, every time we make a change to our recipe and we want to run it again it takes a long time (about 20 minutes).

What we have been doing is making our changes then using:

vagrant destroy

followed by:

vagrant up

It would be nice if somehow we could just re-run our single recipe we are trying to update.

Anyone know how we could do this? Or how vagrant determines our php recipe is already installed/executed?

Was it helpful?

Solution

vagrant provision should do this for you. Chef should take care of only running the things that need to be run...like a changed recipe.

OTHER TIPS

You can use:

vagrant provision

This will rerun the provisioning step, which does vagrant ssh and kicks off Chef.

If you are using a Chef Server with chef-client, you need to upload the cookbook to the server with knife after making local modifications. Then chef-client on the vagrant machine will download the changed files.

If you are using Chef Solo, you can share folders with the VM, so the changes made will be picked up right away, rather than having to copy them over to the VM.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top