{"id":31872,"date":"2026-12-01T22:04:23","date_gmt":"2026-12-01T22:04:23","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=31872"},"modified":"2026-12-01T22:04:23","modified_gmt":"2026-12-01T22:04:23","slug":"chef-tutorials-how-to-looping-and-iterative-in-chef-cookbook-recipe","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/chef-tutorials-how-to-looping-and-iterative-in-chef-cookbook-recipe\/","title":{"rendered":"Chef Tutorials: How to looping and iterative in Chef Cookbook recipe?"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Chef recipes are Ruby, so you loop with ordinary Ruby iterators such as <code>each<\/code>, and each pass declares one Chef resource. This page explains how the loop examples above work, fixes the ones that won&#039;t run as written, and adds patterns for looping over hashes, multi-package installs and custom resources.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/devops-school\/ac4dfd7affa29a771138d7059eeb4640.js\"><\/script>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">How a loop works in a Chef recipe<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A recipe is a Ruby file that Chef Infra Client evaluates in two phases. In the <strong>compile phase<\/strong> Chef runs the Ruby code from top to bottom and adds each resource it finds to the resource collection. In the <strong>converge phase<\/strong> it runs those resources in order. A Ruby loop runs during the compile phase, so a loop over three items adds three separate resources to the collection.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This has two consequences. First, every resource a loop creates needs a unique name, which usually comes from the item itself, for example <code>package pkg<\/code> or <code>directory path<\/code>. Second, the loop can only use data that already exists at compile time, such as node attributes, data bag items or literal arrays. If a value is only produced during the converge phase, for example by a command an earlier resource runs, use <code>lazy { }<\/code> on the property or move that logic into a custom resource.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> In the first two examples above, the block variable is named <code>package<\/code>, the same as the resource. Ruby still treats <code>package package do<\/code> as a method call, so the code runs, but it is hard to read. Name the variable <code>pkg<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Corrected versions of the examples<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Examples 1, 2 and 6 run as written. Examples 3, 4 and 5 will not run correctly if you paste them straight into a recipe. The table lists the problems, and the code after it is a working version of examples 3 and 5.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Example<\/th><th>Problem<\/th><th>Fix<\/th><\/tr><\/thead><tbody><tr><td>1, 2<\/td><td>The block variable <code>package<\/code> has the same name as the resource. Also, on RHEL 8 and later, the <code>ntp<\/code> package has been replaced by <code>chrony<\/code>.<\/td><td>Rename the variable to <code>pkg<\/code>. Use <code>chrony<\/code> on newer Red Hat family systems.<\/td><\/tr><tr><td>3<\/td><td>The <code>default[...]<\/code> lines are attribute syntax. They belong in <code>attributes\/default.rb<\/code>, and inside a recipe they raise an undefined method error.<\/td><td>Move them to the attributes file.<\/td><\/tr><tr><td>3<\/td><td><code>mode 755<\/code> is a decimal integer, so Chef applies the wrong permission bits.<\/td><td>Use the string <code>&#039;0755&#039;<\/code> (or the octal integer <code>0755<\/code>).<\/td><\/tr><tr><td>4<\/td><td><code>django<\/code> is never defined. Also, <code>include_recipe<\/code> loads a given recipe only once per Chef run, so the loop does not run the included recipes once per site.<\/td><td>Use a custom resource and call it once per item (shown below).<\/td><\/tr><tr><td>5, 6<\/td><td><code>utilities_directory<\/code> and <code>files_directory<\/code> are never defined. Building the path with a hard-coded backslash only works on Windows.<\/td><td>Define the variables and build paths with <code>::File.join<\/code>.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># attributes\/default.rb<\/span>\n<span class=\"hljs-keyword\">default<\/span>&#91;<span class=\"hljs-string\">'createdir'<\/span>]&#91;<span class=\"hljs-string\">'shared_dir'<\/span>] = <span class=\"hljs-string\">'shared-lib'<\/span>\n<span class=\"hljs-keyword\">default<\/span>&#91;<span class=\"hljs-string\">'createdir'<\/span>]&#91;<span class=\"hljs-string\">'config_dir'<\/span>] = <span class=\"hljs-string\">'shared-config'<\/span>\n<span class=\"hljs-keyword\">default<\/span>&#91;<span class=\"hljs-string\">'createdir'<\/span>]&#91;<span class=\"hljs-string\">'mode'<\/span>]       = <span class=\"hljs-string\">'0755'<\/span>\n<span class=\"hljs-keyword\">default<\/span>&#91;<span class=\"hljs-string\">'createdir'<\/span>]&#91;<span class=\"hljs-string\">'owner'<\/span>]      = <span class=\"hljs-string\">'ec2-user'<\/span>   <span class=\"hljs-comment\"># must already exist on the node<\/span>\n<span class=\"hljs-keyword\">default<\/span>&#91;<span class=\"hljs-string\">'createdir'<\/span>]&#91;<span class=\"hljs-string\">'group'<\/span>]      = <span class=\"hljs-string\">'root'<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># recipes\/default.rb<\/span>\ncfg = node&#91;<span class=\"hljs-string\">'createdir'<\/span>]\n\n&#91;<span class=\"hljs-string\">\"\/opt\/#{cfg&#91;'shared_dir']}\"<\/span>, <span class=\"hljs-string\">\"\/opt\/#{cfg&#91;'config_dir']}\"<\/span>].each <span class=\"hljs-keyword\">do<\/span> |path|\n  directory path <span class=\"hljs-keyword\">do<\/span>\n    owner     cfg&#91;<span class=\"hljs-string\">'owner'<\/span>]\n    group     cfg&#91;<span class=\"hljs-string\">'group'<\/span>]\n    mode      cfg&#91;<span class=\"hljs-string\">'mode'<\/span>]\n    recursive <span class=\"hljs-keyword\">true<\/span>\n    action    :create\n  end\nend\n\n<span class=\"hljs-comment\"># Example 5\/6 with the variables defined and portable paths<\/span>\nutilities_directory = <span class=\"hljs-string\">'C:\/utilities'<\/span>   <span class=\"hljs-comment\"># or '\/opt\/utilities' on Linux<\/span>\n\ndirectory utilities_directory <span class=\"hljs-keyword\">do<\/span>\n  recursive <span class=\"hljs-keyword\">true<\/span>\nend\n\n%w(fileX.xml fileY.xml fileZ.xml).each <span class=\"hljs-keyword\">do<\/span> |this_file|\n  cookbook_file ::File.join(utilities_directory, this_file) <span class=\"hljs-keyword\">do<\/span>\n    source this_file   <span class=\"hljs-comment\"># looked up under the cookbook's files\/ directory<\/span>\n    action :create\n  end\nend<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\"><code>source<\/code> in <code>cookbook_file<\/code> is resolved relative to the cookbook&#039;s <code>files\/<\/code> directory, so <code>source this_file<\/code> finds <code>files\/fileX.xml<\/code>. Chef on Windows accepts forward slashes in paths, so <code>::File.join<\/code> works on both platforms. The leading <code>::<\/code> makes sure Ruby uses the core <code>File<\/code> class and not Chef&#039;s <code>file<\/code> resource.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Looping over hashes and node attributes<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Real cookbooks usually loop over data held in attributes rather than over literal arrays. That lets roles, environments or Policyfiles change the list without editing the recipe. When you call <code>each<\/code> on a hash, it passes a key and a value to the block.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># attributes\/default.rb<\/span>\n<span class=\"hljs-keyword\">default<\/span>&#91;<span class=\"hljs-string\">'app'<\/span>]&#91;<span class=\"hljs-string\">'users'<\/span>] = {\n  <span class=\"hljs-string\">'deploy'<\/span> =&gt; { <span class=\"hljs-string\">'uid'<\/span> =&gt; <span class=\"hljs-number\">2001<\/span>, <span class=\"hljs-string\">'shell'<\/span> =&gt; <span class=\"hljs-string\">'\/bin\/bash'<\/span> },\n  <span class=\"hljs-string\">'backup'<\/span> =&gt; { <span class=\"hljs-string\">'uid'<\/span> =&gt; <span class=\"hljs-number\">2002<\/span>, <span class=\"hljs-string\">'shell'<\/span> =&gt; <span class=\"hljs-string\">'\/sbin\/nologin'<\/span> },\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># recipes\/users.rb<\/span>\nnode&#91;<span class=\"hljs-string\">'app'<\/span>]&#91;<span class=\"hljs-string\">'users'<\/span>].each <span class=\"hljs-keyword\">do<\/span> |name, props|\n  user name <span class=\"hljs-keyword\">do<\/span>\n    uid         props&#91;<span class=\"hljs-string\">'uid'<\/span>]\n    shell       props&#91;<span class=\"hljs-string\">'shell'<\/span>]\n    manage_home <span class=\"hljs-keyword\">true<\/span>\n    action      :create\n  end\nend\n\n<span class=\"hljs-comment\"># each_with_index when you need a counter<\/span>\n%w(web1 web2 web3).each_with_index <span class=\"hljs-keyword\">do<\/span> |site, i|\n  directory <span class=\"hljs-string\">\"\/srv\/#{site}\"<\/span> <span class=\"hljs-keyword\">do<\/span>\n    mode <span class=\"hljs-string\">'0755'<\/span>\n  end\n\n  file <span class=\"hljs-string\">\"\/srv\/#{site}\/port\"<\/span> <span class=\"hljs-keyword\">do<\/span>\n    content <span class=\"hljs-string\">\"#{8080 + i}\\n\"<\/span>\n  end\nend<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Other Ruby iterators work the same way, for example <code>3.times { |i| ... }<\/code>, <code>select<\/code> or <code>reject<\/code> to filter a list first, and <code>sort<\/code> when the order of resources matters.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installing several packages without a loop<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">For packages you often don&#039;t need a loop at all. The <code>package<\/code> resource accepts an array on platforms whose package provider supports it, including apt, yum and dnf. Chef then installs every package in one package-manager call, which is faster than running a separate transaction for each package.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">package %w(vim git chrony) <span class=\"hljs-keyword\">do<\/span>\n  <span class=\"hljs-attr\">action<\/span> :install\nend<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Use a loop when each item needs different properties, for example a different version or its own notifications.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Replacing the include_recipe loop with a custom resource<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Example 4 tries to repeat a set of recipes once per site. That doesn&#039;t work, because <code>include_recipe<\/code> ignores any recipe that is already in the run. Changing <code>node.default<\/code> inside the loop also only changes one shared attribute, so every site ends up with the last value. The supported way to repeat a group of resources with different inputs is a custom resource.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># resources\/django_site.rb   (cookbook name: my_app)<\/span>\nunified_mode <span class=\"hljs-keyword\">true<\/span>\n\nproperty :site_name, String, name_property: <span class=\"hljs-keyword\">true<\/span>\nproperty :port, Integer, <span class=\"hljs-keyword\">default<\/span>: <span class=\"hljs-number\">8000<\/span>\n\naction :create <span class=\"hljs-keyword\">do<\/span>\n  template <span class=\"hljs-string\">\"\/etc\/nginx\/conf.d\/#{new_resource.site_name}.conf\"<\/span> <span class=\"hljs-keyword\">do<\/span>\n    source <span class=\"hljs-string\">'nginx-site.conf.erb'<\/span>\n    variables(name: new_resource.site_name, port: new_resource.port)\n  end\n\n  <span class=\"hljs-comment\"># add gunicorn \/ supervisor resources for the site here<\/span>\nend<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># attributes\/default.rb<\/span>\n<span class=\"hljs-keyword\">default<\/span>&#91;<span class=\"hljs-string\">'my_app'<\/span>]&#91;<span class=\"hljs-string\">'sites'<\/span>] = &#91;\n  { <span class=\"hljs-string\">'name'<\/span> =&gt; <span class=\"hljs-string\">'shop'<\/span>, <span class=\"hljs-string\">'port'<\/span> =&gt; <span class=\"hljs-number\">8001<\/span> },\n  { <span class=\"hljs-string\">'name'<\/span> =&gt; <span class=\"hljs-string\">'blog'<\/span>, <span class=\"hljs-string\">'port'<\/span> =&gt; <span class=\"hljs-number\">8002<\/span> },\n]\n\n<span class=\"hljs-comment\"># recipes\/default.rb<\/span>\nnode&#91;<span class=\"hljs-string\">'my_app'<\/span>]&#91;<span class=\"hljs-string\">'sites'<\/span>].each <span class=\"hljs-keyword\">do<\/span> |site|\n  my_app_django_site site&#91;<span class=\"hljs-string\">'name'<\/span>] <span class=\"hljs-keyword\">do<\/span>\n    port site&#91;<span class=\"hljs-string\">'port'<\/span>]\n  end\nend<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Chef names the resource after the cookbook and the file name (<code>my_app<\/code> + <code>django_site<\/code>). Each loop pass creates its own instance with its own properties, so every site is configured separately.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Running and verifying the recipe<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Lint the cookbook with <code>cookstyle .<\/code> from the cookbook directory. It catches style problems and common mistakes, such as a numeric <code>mode<\/code>.<\/li>\n\n\n<li>Converge locally without a Chef Infra Server: <code>sudo chef-client --local-mode --runlist &#039;recipe[my_app]&#039;<\/code> from your chef-repo directory.<\/li>\n\n\n<li>Check the output. Each loop item should appear as its own resource, for example one <code>directory[\/opt\/shared-lib]<\/code> entry and one <code>directory[\/opt\/shared-config]<\/code> entry.<\/li>\n\n\n<li>Run the converge again. A correct recipe reports <code>0\/N resources updated<\/code> on the second run, which shows that it is idempotent.<\/li>\n\n\n<li>Check the result on the node, for example <code>stat -c &#039;%a %U&#039; \/opt\/shared-lib<\/code> should print <code>755 ec2-user<\/code>.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">For repeatable testing on throwaway machines, run the same recipe with Test Kitchen and check the result with InSpec controls.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Common errors and best practices<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>undefined method &#039;default&#039;<\/code> in a recipe:<\/strong> you used attribute syntax inside a recipe. Move it to <code>attributes\/default.rb<\/code>, or use <code>node.default[...]<\/code> if you really must set it in the recipe.<\/li>\n\n\n<li><strong><code>undefined local variable or method<\/code>:<\/strong> a variable such as <code>django<\/code> or <code>files_directory<\/code> was never defined. Define it, or read it from <code>node[...]<\/code>.<\/li>\n\n\n<li><strong>Wrong permissions such as <code>1363<\/code>:<\/strong> <code>mode<\/code> was given as a decimal integer. Use quoted strings like <code>&#039;0644&#039;<\/code>.<\/li>\n\n\n<li><strong>Notifications hit the wrong resource:<\/strong> two loop passes created resources with the same name. Build the name from the loop item so each one is unique.<\/li>\n\n\n<li><strong><code>user does not exist<\/code> on <code>owner<\/code>:<\/strong> the owner must already exist on the node. Create it earlier in the run with a <code>user<\/code> resource.<\/li>\n\n\n<li>Keep the list of items in attributes and the logic in the recipe, so you can change the list per environment without editing code.<\/li>\n\n\n<li>Avoid <code>ruby_block<\/code> or <code>execute<\/code> inside loops when a native resource exists. Native resources are idempotent and report changes properly.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently asked questions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">How do I loop through an array in a Chef recipe?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Call Ruby&#039;s <code>each<\/code> on the array and declare a resource inside the block, for example <code>%w(vim git).each { |pkg| package pkg }<\/code>. Chef adds one resource for each element during the compile phase.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Can I install multiple packages in Chef without a loop?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. On platforms whose provider supports it, such as apt, yum and dnf, you can pass an array to <code>package<\/code>, for example <code>package %w(vim git chrony)<\/code>. Chef then installs all of them in a single package-manager call.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Why does include_recipe inside a loop only run once?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Chef includes each recipe only once per run, and later <code>include_recipe<\/code> calls for the same recipe do nothing. To repeat a set of resources with different inputs, write a custom resource and call it once per item.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How do I loop over a hash of attributes in Chef?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use <code>node[&#039;app&#039;][&#039;users&#039;].each do |name, props| ... end<\/code>. The block receives each key and its value, so you can use <code>props[&#039;uid&#039;]<\/code> and similar values as resource properties.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Why is my directory created with the wrong permissions in a loop?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>mode<\/code> was probably given as an unquoted decimal number such as <code>755<\/code>. Chef reads that as decimal, not octal. Use a string such as <code>&#039;0755&#039;<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Related tutorials<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/category\/infrastructure-as-code\/chef\/\">More Chef tutorials<\/a><\/li>\n\n\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/what-is-chef-and-use-cases-of-chef\/\">What is Chef and use cases of Chef?<\/a><\/li>\n\n\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/chef-tutorials-knife-command-line-reference\/\">Chef Tutorials: knife command line reference<\/a><\/li>\n\n\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/top-50-chef-interview-questions-and-answers\/\">Top 50 Chef interview questions and answers<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Chef recipes are Ruby, so you loop with ordinary Ruby iterators such as each, and each pass declares one Chef resource. This page explains how the loop&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[88],"tags":[1659,4799],"class_list":["post-31872","post","type-post","status-publish","format-standard","hentry","category-chef","tag-chef-cookbooks","tag-chef-recipes"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/31872","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=31872"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/31872\/revisions"}],"predecessor-version":[{"id":80492,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/31872\/revisions\/80492"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=31872"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=31872"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=31872"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}