Reputation: 3628
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?
Upvotes: 18
Views: 3670
Reputation: 8258
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.
Upvotes: 5
Reputation: 706
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.
Upvotes: 20