1.

What is Chef shell and why it’s used?

Answer»

Chef shell is an interactive tool to WORK with resources. It HELPS to do REPL with the resources.chef-shell provides an easy METHOD to test resources interactively rather than UPLOADING our cookbook to Chef Server and applying it on Chef nodes. Breakpoints could be added on to the recipe execution using chef-shell.chef-shell could be used in three modes

  • Standalone mode runs Chef with nothing loaded but interactively. This is the default behaviour of chef-shell if nothing specified.
  • Solo mode runs chef-shell as the chef-solo client. This mode is enabled by using “-s” or “--solo” command-line flag. This mode loads all cookbooks as in the case of chef-solo and uses any JSON file provided with “-J” command-line option.
  • Client mode makes chef-shell to run as in the case of chef-client on the host. This mode is invoked by “-z” or “--client” command-line flag.chef-shell uses local client configuration to connect to Chef Server and download the relevant run_lists, attributes or cookbooks. We can override the server URL in the client configuration by providing “-s” command-line option. “-c” command-line option could also be used to use a different configuration file for chef-shell.


Discussion

No Comment Found