{"id":419,"date":"2015-08-18T16:20:57","date_gmt":"2015-08-18T16:20:57","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/2015\/08\/18\/chef-documenting-cookbooks-automatically\/"},"modified":"2021-07-13T14:46:06","modified_gmt":"2021-07-13T14:46:06","slug":"chef-documenting-cookbooks-automatically","status":"publish","type":"post","link":"https:\/\/www.scmgalaxy.com\/tutorials\/chef-documenting-cookbooks-automatically\/","title":{"rendered":"Chef &#8211; Documenting Cookbooks automatically"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3444 aligncenter\" src=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2015\/08\/chef-documenting-cookbooks.png\" alt=\"chef-documenting-cookbooks\" width=\"600\" height=\"400\" srcset=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2015\/08\/chef-documenting-cookbooks.png 600w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2015\/08\/chef-documenting-cookbooks-300x200.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p><strong>Problems Area &#8211;<\/strong><\/p>\n<p>Our infrastructure has many cookbooks that aim to be reusable, primarily through encapsulating behaviour in LWRPs. This led to an explosion of LWRPs and sometimes the documentation didn&#8217;t keep up or did just not exist.<\/p>\n<p><strong>Solution 1: Follow Best Practices\u00a0<\/strong><\/p>\n<p>This command will create a README.rdoc by default, and I prefer <a href=\"https:\/\/www.collectiveray.com\/markdown-cheat-sheet\">Markdown<\/a>, so I specify the -r md option.<\/p>\n<pre>&gt; knife cookbook create smartmontools -r md<\/pre>\n<p><strong>Solution 2: Automate using plugins<\/strong><\/p>\n<p>README.md which should be generated automatcially must contain information about the recipes, attributes, platform compatibility and cookbook requirements (i.e. depends, recommends, suggests etc).<\/p>\n<p>Mathias Lafeldt wrote a knife plugin that generates an initial README.md from the metadata.rb file in a a cookbook.<\/p>\n<p>Link &#8211;<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/mlafeldt\/knife-cookbook-readme\">https:\/\/github.com\/mlafeldt\/knife-cookbook-readme<\/a><\/li>\n<li><a href=\"http:\/\/mlafeldt.github.io\/knife-cookbook-readme\/\">http:\/\/mlafeldt.github.io\/knife-cookbook-readme\/<\/a><\/li>\n<\/ul>\n<p>Extension of Mathias Lafeldt was done here with regenerate README.md from the cookbook source code<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/realityforge\/knife-cookbook-doc\">https:\/\/github.com\/realityforge\/knife-cookbook-doc<\/a><\/li>\n<\/ul>\n<p><strong>Please refer these useful blogs as well which is referenced in order to write this article&#8230;<\/strong><\/p>\n<ul>\n<li><a href=\"http:\/\/realityforge.org\/code\/2013\/04\/01\/documenting-cookbooks.html\">http:\/\/realityforge.org\/code\/2013\/04\/01\/documenting-cookbooks.html<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Problems Area &#8211; Our infrastructure has many cookbooks that aim to be reusable, primarily through encapsulating behaviour in LWRPs. This [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":3444,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[88],"tags":[1651,1650,795,1649,1652,407,642,1648,604,1472,1050,1646,1647],"class_list":["post-419","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-chef","tag-auto","tag-automate","tag-automatically","tag-automation","tag-best-practices","tag-chef","tag-chef-cookbook","tag-chef-cookbook-documentation","tag-chef-guide","tag-chef-tutorial","tag-cookbooks","tag-documentation","tag-documenting-cookbooks"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Chef - Documenting Cookbooks automatically - scmGalaxy<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.scmgalaxy.com\/tutorials\/chef-documenting-cookbooks-automatically\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Chef - Documenting Cookbooks automatically - scmGalaxy\" \/>\n<meta property=\"og:description\" content=\"Problems Area &#8211; Our infrastructure has many cookbooks that aim to be reusable, primarily through encapsulating behaviour in LWRPs. This [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/chef-documenting-cookbooks-automatically\/\" \/>\n<meta property=\"og:site_name\" content=\"scmGalaxy\" \/>\n<meta property=\"article:published_time\" content=\"2015-08-18T16:20:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-07-13T14:46:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2015\/08\/chef-documenting-cookbooks.png\" \/>\n\t<meta property=\"og:image:width\" content=\"600\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"scmgalaxy K\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"scmgalaxy K\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/chef-documenting-cookbooks-automatically\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/chef-documenting-cookbooks-automatically\\\/\"},\"author\":{\"name\":\"scmgalaxy K\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\"},\"headline\":\"Chef &#8211; Documenting Cookbooks automatically\",\"datePublished\":\"2015-08-18T16:20:57+00:00\",\"dateModified\":\"2021-07-13T14:46:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/chef-documenting-cookbooks-automatically\\\/\"},\"wordCount\":173,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/chef-documenting-cookbooks-automatically\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2015\\\/08\\\/chef-documenting-cookbooks.png\",\"keywords\":[\"Auto\",\"Automate\",\"Automatically\",\"Automation\",\"Best Practices\",\"Chef\",\"Chef cookbook\",\"Chef cookbook documentation\",\"Chef Guide\",\"Chef Tutorial\",\"Cookbooks\",\"Documentation\",\"Documenting Cookbooks\"],\"articleSection\":[\"Chef\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/chef-documenting-cookbooks-automatically\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/chef-documenting-cookbooks-automatically\\\/\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/chef-documenting-cookbooks-automatically\\\/\",\"name\":\"Chef - Documenting Cookbooks automatically - scmGalaxy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/chef-documenting-cookbooks-automatically\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/chef-documenting-cookbooks-automatically\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2015\\\/08\\\/chef-documenting-cookbooks.png\",\"datePublished\":\"2015-08-18T16:20:57+00:00\",\"dateModified\":\"2021-07-13T14:46:06+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/chef-documenting-cookbooks-automatically\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/chef-documenting-cookbooks-automatically\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/chef-documenting-cookbooks-automatically\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2015\\\/08\\\/chef-documenting-cookbooks.png\",\"contentUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2015\\\/08\\\/chef-documenting-cookbooks.png\",\"width\":600,\"height\":400,\"caption\":\"chef-documenting-cookbooks\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/chef-documenting-cookbooks-automatically\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Chef &#8211; Documenting Cookbooks automatically\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\",\"name\":\"scmGalaxy\",\"description\":\"A Platform for Software Engineers\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\",\"name\":\"scmgalaxy K\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g\",\"caption\":\"scmgalaxy K\"},\"sameAs\":[\"http:\\\/\\\/www.DevOpsSchool.com\"],\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/author\\\/scmgalaxy\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Chef - Documenting Cookbooks automatically - scmGalaxy","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.scmgalaxy.com\/tutorials\/chef-documenting-cookbooks-automatically\/","og_locale":"en_US","og_type":"article","og_title":"Chef - Documenting Cookbooks automatically - scmGalaxy","og_description":"Problems Area &#8211; Our infrastructure has many cookbooks that aim to be reusable, primarily through encapsulating behaviour in LWRPs. This [&hellip;]","og_url":"https:\/\/www.scmgalaxy.com\/tutorials\/chef-documenting-cookbooks-automatically\/","og_site_name":"scmGalaxy","article_published_time":"2015-08-18T16:20:57+00:00","article_modified_time":"2021-07-13T14:46:06+00:00","og_image":[{"width":600,"height":400,"url":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2015\/08\/chef-documenting-cookbooks.png","type":"image\/png"}],"author":"scmgalaxy K","twitter_card":"summary_large_image","twitter_misc":{"Written by":"scmgalaxy K","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/chef-documenting-cookbooks-automatically\/#article","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/chef-documenting-cookbooks-automatically\/"},"author":{"name":"scmgalaxy K","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102"},"headline":"Chef &#8211; Documenting Cookbooks automatically","datePublished":"2015-08-18T16:20:57+00:00","dateModified":"2021-07-13T14:46:06+00:00","mainEntityOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/chef-documenting-cookbooks-automatically\/"},"wordCount":173,"commentCount":0,"image":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/chef-documenting-cookbooks-automatically\/#primaryimage"},"thumbnailUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2015\/08\/chef-documenting-cookbooks.png","keywords":["Auto","Automate","Automatically","Automation","Best Practices","Chef","Chef cookbook","Chef cookbook documentation","Chef Guide","Chef Tutorial","Cookbooks","Documentation","Documenting Cookbooks"],"articleSection":["Chef"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.scmgalaxy.com\/tutorials\/chef-documenting-cookbooks-automatically\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/chef-documenting-cookbooks-automatically\/","url":"https:\/\/www.scmgalaxy.com\/tutorials\/chef-documenting-cookbooks-automatically\/","name":"Chef - Documenting Cookbooks automatically - scmGalaxy","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/chef-documenting-cookbooks-automatically\/#primaryimage"},"image":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/chef-documenting-cookbooks-automatically\/#primaryimage"},"thumbnailUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2015\/08\/chef-documenting-cookbooks.png","datePublished":"2015-08-18T16:20:57+00:00","dateModified":"2021-07-13T14:46:06+00:00","author":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102"},"breadcrumb":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/chef-documenting-cookbooks-automatically\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.scmgalaxy.com\/tutorials\/chef-documenting-cookbooks-automatically\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/chef-documenting-cookbooks-automatically\/#primaryimage","url":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2015\/08\/chef-documenting-cookbooks.png","contentUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2015\/08\/chef-documenting-cookbooks.png","width":600,"height":400,"caption":"chef-documenting-cookbooks"},{"@type":"BreadcrumbList","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/chef-documenting-cookbooks-automatically\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.scmgalaxy.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Chef &#8211; Documenting Cookbooks automatically"}]},{"@type":"WebSite","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website","url":"https:\/\/www.scmgalaxy.com\/tutorials\/","name":"scmGalaxy","description":"A Platform for Software Engineers","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.scmgalaxy.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102","name":"scmgalaxy K","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g","caption":"scmgalaxy K"},"sameAs":["http:\/\/www.DevOpsSchool.com"],"url":"https:\/\/www.scmgalaxy.com\/tutorials\/author\/scmgalaxy\/"}]}},"_links":{"self":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/419","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/comments?post=419"}],"version-history":[{"count":3,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/419\/revisions"}],"predecessor-version":[{"id":6733,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/419\/revisions\/6733"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media\/3444"}],"wp:attachment":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media?parent=419"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/categories?post=419"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/tags?post=419"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}