Logo Questions Linux Laravel Mysql Ubuntu Git Menu

How do I view a recipe on a chef server?

knife search node '*:*' -a recipes

gives me all the nodes and their recipes.

knife node show NODE_ID -a recipes

gives me recipes used by a specific node with NODE_ID.

I need to fetch the contents of the recipes that these commands fetch. Even a command to view a specific recipe on the chef server would suffice.

like image 811
ashokgadeking Avatar asked Feb 15 '17 19:02


Video Answer

2 Answers

knife cookbook show COOKNAME VERSION recipes RECIPENAME.rb

You can also tweak that for other types of files inside a cookbook.

like image 87
coderanger Avatar answered Sep 20 '22 21:09


You can use the knife cookbook show COOKBOOK [VERSION] [PART] [FILENAME] command:

knife cookbook show mycookbook 1.2.3 recipes default.rb

outputs the default recipe of mycookbook's version 1.2.3

like image 25
StephenKing Avatar answered Sep 20 '22 21:09