1.

Differentiate between chef-apply and chef-client?

Answer»

Chef-apply is an in-built utility in Chef development kit. It helps to run a recipe from the command line. The basic syntax for chef-apply is as follows:

  • chef-apply test.rb, where test.rb is the recipe which is run.
  • chef-apply with “-E” option COULD be used to execute a resource. For eg:
  • chef-apply -e "package 'NGINX'" installs ‘nginx’ package.chef-apply could be run in a why-run mode where everything of a chef-client run is performed except modification of the system.
  • chef-client is an agent that is run on every node to modify the node so that it attains the desired state. chef-client applies cookbook on to any node managed by Chef Server. During a Chef Client run the following activities TAKE place
    • Registering a node with Chef Server
    • Synchronising cookbooks to be run on Chef node
    • Rebuilding node objects retrieved from Chef Server. In the case of the first Chef Client run, there won't be any node object from Chef Server.
    • Compiling resource collection
    • Performing all actions on the node to CONFIGURE the node to the desired state.


Discussion

No Comment Found