Are you looking to create Chef cookbooks to manage your Dell EMC servers ? This blog talks about how to write a cookbook module to manage DellEMC machines.

What is Chef?

 

Chef is a powerful automation platform that transforms infrastructure into code. Whether you’re operating in the cloud, on-premises, or in a hybrid environment, Chef automates how infrastructure is configured, deployed, and managed across your network, no matter its size.

This diagram shows how you develop, test, and deploy your Chef code.

  1. The Chef DK workstation is the location where users interact with Chef. On the workstation users write and test cookbooks using tools like Test Kitchen and interact with the Chef server using the knife and chef command line tools.
  2. Chef client nodes are the machines that are managed by Chef. The Chef client is installed on each node and is used to configure the node to its desired state.
  3. The Chef server acts as a hub for configuration data. The Chef server stores cookbooks, the policies that are applied to nodes, and metadata that describes each registered node managed by Chef. Nodes use the Chef client to ask the Chef server for configuration details, such as recipes, templates, and files. 

Let's first review the basic system requirements for installing ChefDK workstation, Chef client nodes, & Chef server:

  • Ensure that each machine that will be a node is running a platform
  • Ensure that the machine that will run the Chef server is sufficiently powerful
  • Ensure that any network and firewall settings are configured correctly

More detailed system requirements are listed below.

https://github.com/chef/chef-web-docs/blob/master/chef_master/source/chef_system_requirements.rst

 

A simple Hello World Chef recipe file.

A simple hello world cookbook to create a file in the local server look like this: (Click on the below JPG image to view it in Full Screen)

As you can see the file.rb didn’t throw an error but gave the output as “up to date”. This is because the file we are attempting to create already exists. When removing the file, the Chef-apply command successfully executes the recipe locally creating the specific file.

Chef maintains different folders as part of metadata and more than one recipe can also be part of the cookbook. Below is an example on how to Power Off a DellEMC machine using a recipe.

Case 1: Power Off a server (Click on the below JPG image to view it in Full Screen)

Executing the following recipe turns the server off:(Click on the below JPG image to view it in Full Screen)

Additional Chef Recipes for Dell Systems can be found on the Chef Supermarket.

Disclaimer :- This Chef Recipe modules are not officially supported on any Dell Servers. 

To learn more about Dell Custom Solutions Engineering visit www.dell.com/customsolutions