Search code examples
chef-infraknife

Is it possible to run chef-client from within a knife exec command?


Looking to update node attributes (derived from a cookbook) using knife exec. I'd like to trigger chef-client after that so the cookbook can make the corresponding updates on the node. Is it possible to trigger the check-in from the same knife exec block, or do I need a separate knife ssh call (or similar) in order to check the node in?


Solution

  • knife exec executes Ruby code on the Chef Server. Indeed, you need to log into the nodes and trigger chef-client, either through knife ssh, Chef Push Jobs, Rundeck, etc.