Reputation: 18602
This is kind of a n00b question, but the Chef docs don't help.
Say I changed the code of a cookbook. I upload it to my chef server. Ho do I apply the changes to my nodes using this cookbook?
Upvotes: 2
Views: 4423
Reputation: 8258
As Draco commented, you run Chef on your node(s). They will automatically download the changed files in the cookbook from the server.
sudo chef-client
If you're running Chef as a service (setup via Opscode's chef-client cookbook service recipe or otherwise), it will automatically run at some point. Since you're using a Chef Server, you can also use knife ssh
to perform a search and run the command on multiple nodes at one time.
knife ssh "*:*" "sudo chef-client" -x youruser
Replace ":" with any Chef Search Query.
Also, this is where Environments are useful, in that you can pin particular versions of cookbooks to nodes in an environment, so they don't get the changes that were made in the cookbook until you modify the version they're allowed to use. For example, if you have version 1.0.0 of your cookbook, and pin "production" to that ("= 1.0.0"), then increment the version (1.0.1) before uploading, then production nodes won't get the new version until the version in the environment is updated to the newer version.
Upvotes: 9