Chef Recipe Node
Suppose you want to set some swap size depending on swap details are set or not.
Chef recipe node. Recipes are written in ruby and contain information about everything that needs to be run changed or created on a node. Use knife to add a recipe to the run list for a node. How can i get ip address returned by node search in chef recipe ruby. The below command just run only one specific cookbook and an up to date cookbook which is set in chef environment.
Knife node run list add nodename recipe apache2 more than one recipe can be added. How to access attributes using. Knife node run list add nodename recipe apache2 recipe mysql role ssh which. This is similar to factor in puppet setup module in ansible.
Both roles and recipes must be in quotes for example. The rebuilt node object from the current chef infra client run after it is updated for changes to cookbooks attribute files and or recipes roles and or environments and updated for any changes to the state of the node itself. A run list must be in one of the following formats. A chef cookbook is comprised of recipes that a nodes desired state.
Running shell step 1 run chef shell in a standalone mode. This information is used to populate in cookbooks before they compile and execute when check client runs on the chef node. Chef client once o my cook book. Root linuxnix chef client once o surendra splunk starting chef client version 12 21 3 resolving cookbooks for run list.
Stored as part of the node object on the chef server. On a node these recipes can be assigned to a node s run list similar to. The rebuilt node object from the current chef infra client run after it is updated for changes to cookbooks attribute files and or recipes roles and or environments and updated for any changes to the state of the node itself. The node object that was saved to the chef infra server at the end of the previous chef infra client run.
The chef will never know what the swap size is it depends on ohai to collect these system details. Use the run list add argument to add run list items roles or recipes to a node. Share follow asked nov 12 12 at 0 52. Recipes work as a collection of resources that determine the configuration or policy of a node with resources being a configuration element of the recipe.
Maintained using knife and then uploaded from the workstation to the chef infra server or maintained using chef automate. It is used to evaluate parts of recipes on the fly before uploading them to chef server and execute complete cookbooks on the node. The node object that was saved to the chef infra server at the end of the previous chef infra client run. Recipe apache2 recipe apache2 mod ssl chef infra server.
Fully qualified cookbook or default.