1.

Explain chef-solo?

Answer»

chef-solo is a command where Chef Client is run in a way that it doesn’t require Chef Server to get the required cookbooks.chef-solo make use of the local mode of the chef-client run. It doesn’t require authorisation as in the case of Chef Servers. It also doesn’t PROVIDE a centralised distribution of cookbooks or centralised API to interact with infrastructure components. Cookbooks could be loaded from two different locations i.e from a local directory or a URL where the tar.gz archive is present. In chef-solo, the node OBJECTS are stored in the form of JSON files in a local DISK rather than as node objects in Chef Server. For eg:

chef-solo -c ~/solo.rb -j ~/node.json -r  http://www.sample.com/chef-solo.tar.gz

runs chef-solo with solo.rb configuration file using node.json file and retrieves cookbook from the http://www.sample.com/chef-solo.tar.gz URL.

The basic workflow for chef-solo is as follows:

  • Chef Workstation should have “solo.rb” and “node.json” file inside the chef-repo directory
  • Add “solo.rb” and “node.json” to the git repository
  • Create or download the cookbooks from Chef Supermarket 
  • Commit and push the files to git repo
  • If you want to run chef-solo in a Chef Node, 
    • Login to the chef node where the chef-solo is going to be run
    • Clone the chef-repo from git with the relevant cookbooks that need to be APPLIED on the Chef node
    • Run the “chef-solo” command by SPECIFYING “solo.rb” file and “node.json” file to be used.


Discussion

No Comment Found