{"id":31852,"date":"2022-11-22T06:32:45","date_gmt":"2022-11-22T06:32:45","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=31852"},"modified":"2022-12-23T05:45:28","modified_gmt":"2022-12-23T05:45:28","slug":"chef-tutorials-working-with-ohai","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/chef-tutorials-working-with-ohai\/","title":{"rendered":"Chef Tutorials: Working with Ohai"},"content":{"rendered":"\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>Ohai is a tool for collecting system configuration data, which it then provides to Chef Infra Client to use in cookbooks. Chef Infra Client runs Ohai at the start of every Chef Infra run to determine system state. The attributes that Ohai collects are called automatic attributes. Chef Infra Client uses these attributes to ensure that nodes are in the desired state after each configuration run.<\/p>\n\n\n\n<p>The types of attributes Ohai collects include but are not limited to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Operating System<\/li>\n\n\n\n<li>Network<\/li>\n\n\n\n<li>Memory<\/li>\n\n\n\n<li>Disk<\/li>\n\n\n\n<li>CPU<\/li>\n\n\n\n<li>Kernel<\/li>\n\n\n\n<li>Host names<\/li>\n\n\n\n<li>Fully qualified domain names<\/li>\n\n\n\n<li>Virtualization<\/li>\n\n\n\n<li>Cloud provider metadata<\/li>\n<\/ul>\n\n\n\n<p>Ohai collects data for many platforms, including<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>AIX,<\/li>\n\n\n\n<li>macOS,<\/li>\n\n\n\n<li>Linux,<\/li>\n\n\n\n<li>FreeBSD,<\/li>\n\n\n\n<li>Solaris, and<\/li>\n\n\n\n<li>any Windows operating systems.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"837\" height=\"901\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/11\/image-22.png\" alt=\"\" class=\"wp-image-31853\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/11\/image-22.png 837w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/11\/image-22-279x300.png 279w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/11\/image-22-768x827.png 768w\" sizes=\"auto, (max-width: 837px) 100vw, 837px\" \/><\/figure>\n\n\n\n<script src=\"https:\/\/gist.github.com\/devops-school\/768bfbc42c274f27a41af8dfef4a2c0c.js\"><\/script>\n","protected":false},"excerpt":{"rendered":"<p>Ohai is a tool for collecting system configuration data, which it then provides to Chef Infra Client to use in cookbooks. Chef Infra Client runs Ohai at the start of every Chef Infra run to determine system state. The attributes that Ohai collects are called automatic attributes. Chef Infra Client uses these attributes to ensure&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_joinchat":[],"footnotes":""},"categories":[2],"tags":[],"class_list":["post-31852","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/31852","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=31852"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/31852\/revisions"}],"predecessor-version":[{"id":31858,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/31852\/revisions\/31858"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=31852"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=31852"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=31852"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}