{"id":5000,"date":"2018-06-06T10:43:16","date_gmt":"2018-06-06T10:43:16","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=5000"},"modified":"2021-11-17T10:28:48","modified_gmt":"2021-11-17T10:28:48","slug":"chef-node-objects-defined","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/chef-node-objects-defined\/","title":{"rendered":"Understanding Chef Node Objects json content!"},"content":{"rendered":"<p>Chef Node Objects Defined!<\/p>\n<p>For the chef-client, two important aspects of nodes are groups of attributes and run-lists.<\/p>\n<ol>\n<li>An attribute is a specific piece of data about the node, such as a network interface, a file system, the number of clients a service running on a node is capable of accepting, and so on.<\/li>\n<li>A run-list is an ordered list of recipes and\/or roles that are run in an exact order.<\/li>\n<\/ol>\n<p>The node object consists of the run-list and node attributes, which is a JSON file that is stored on the Chef server. The chef-client gets a copy of the node object from the Chef server during each chef-client run and places an updated copy on the Chef server at the end of each chef-client run.<\/p>\n<p>An attribute is a specific detail about a node. Attributes are used by the chef-client to understand:<\/p>\n<ul>\n<li>The current state of the node<\/li>\n<li>What the state of the node was at the end of the previous chef-client run<\/li>\n<li>What the state of the node should be at the end of the current chef-client run<\/li>\n<\/ul>\n<p>Attributes are defined by:<\/p>\n<ul>\n<li>The state of the node itself<\/li>\n<li>Cookbooks (in attribute files and\/or recipes)<\/li>\n<li>Roles<\/li>\n<li>Environments<\/li>\n<\/ul>\n<p>During every chef-client run, the chef-client builds the attribute list using:<\/p>\n<ul>\n<li>Data about the node collected by Ohai<\/li>\n<li>The node object that was saved to the Chef server at the end of the previous chef-client run<\/li>\n<li>The rebuilt node object from the current chef-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<\/li>\n<\/ul>\n<p>After the node object is rebuilt, all of the attributes are compared, and then the node is updated based on attribute precedence. At the end of every chef-client run, the node object that defines the current state of the node is uploaded to the Chef server so that it can be indexed for search.<\/p>\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_86559\"><iframe loading=\"lazy\"  id=\"_ytid_76243\"  width=\"760\" height=\"427\"  data-origwidth=\"760\" data-origheight=\"427\" src=\"https:\/\/www.youtube.com\/embed\/?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;\" class=\"__youtube_prefs__  no-lazyload\" title=\"YouTube player\"  data-epytgalleryid=\"epyt_gallery_86559\"  allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe><div class=\"epyt-gallery-list\"><div>Sorry, there was a YouTube error.<\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Chef Node Objects Defined! For the chef-client, two important aspects of nodes are groups of attributes and run-lists. An attribute is a specific piece of data about the node, such&#8230; <\/p>\n","protected":false},"author":1,"featured_media":5015,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[88],"tags":[407,4937],"class_list":["post-5000","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-chef","tag-chef","tag-node-objects"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/5000","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=5000"}],"version-history":[{"count":5,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/5000\/revisions"}],"predecessor-version":[{"id":25601,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/5000\/revisions\/25601"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/5015"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=5000"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=5000"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=5000"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}