Reputation: 8885
If a node's role was defined as, for example, apache2, and assuming the chef-client checks every X seconds interval for changes, how can the chef-server know that the role was successfully applied and that the service defined by apache2 ( httpd ) is up/running ?
The use case for the above is to perform some orchestration, where roles are assigned and then some sort of loop checks to see if the service is completed and running, before proceeding to a next stage assigment.
Upvotes: 1
Views: 610
Reputation: 77951
Consider enabling the lastrun handler, the code will set a number of node attributes that can be used to determine the state of the last chef client run.
Chef is a declarative language. One must assume that if the recipe states the service should be running and client completes without error, then the service is indeed running.
Another option would be to kick-start run the chef client using the knife command
knife ssh "role:webserver" "sudo chef-client"
This will ensure that all your nodes are properly converged.
Upvotes: 2