{"id":4934,"date":"2018-05-02T09:36:20","date_gmt":"2018-05-02T09:36:20","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=4934"},"modified":"2021-02-27T09:07:03","modified_gmt":"2021-02-27T09:07:03","slug":"how-to-run-chef-client-in-why-run-mode-aka-no-operation","status":"publish","type":"post","link":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-run-chef-client-in-why-run-mode-aka-no-operation\/","title":{"rendered":"How to run chef-client in why-run mode aka \u201cno-operation\u201d"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5017\" src=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/05\/chef-client.jpg\" alt=\"\" width=\"600\" height=\"350\" srcset=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/05\/chef-client.jpg 600w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/05\/chef-client-300x175.jpg 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>why-run mode is a way to see what the chef-client would have configured, had an actual chef-client run occurred. This approach is similar to the concept of \u201cno-operation\u201d (or \u201cno-op\u201d): decide what should be done, but then don\u2019t actually do anything until it\u2019s done right. Run the executable in why-run mode, which is a type of chef-client run that does everything except modify the system.<\/p>\n<p>When why-run mode is enabled, a chef-client run will occur that does everything up to the point at which configuration would normally occur. This includes<\/p>\n<ol>\n<li>Getting the configuration data,<\/li>\n<li>Authenticating to the Chef server,<\/li>\n<li>Rebuilding the node object,<\/li>\n<li>Expanding the run-list,<\/li>\n<li>Getting the necessary cookbook files,<\/li>\n<li>Resetting node attributes,<\/li>\n<li>Identifying the resources, and<\/li>\n<li>Building the resource collection and<\/li>\n<li>Does not include mapping each resource to a provider or configuring any part of the system.<\/li>\n<\/ol>\n<p><strong>How to run chef-client?<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ sudo chef-client -o 'recipe&#x5B;ntp]' --why-run\r\n$ sudo chef-client -o 'recipe&#x5B;ntp]' -W<\/pre>\n<p><a href=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/05\/chef-why-run-mode-chef-client.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4935\" src=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/05\/chef-why-run-mode-chef-client.png\" alt=\"\" width=\"1029\" height=\"569\" srcset=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/05\/chef-why-run-mode-chef-client.png 1029w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/05\/chef-why-run-mode-chef-client-300x166.png 300w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/05\/chef-why-run-mode-chef-client-768x425.png 768w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/05\/chef-why-run-mode-chef-client-1024x566.png 1024w\" sizes=\"auto, (max-width: 1029px) 100vw, 1029px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>why-run mode is a way to see what the chef-client would have configured, had an actual chef-client run occurred. This [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":5019,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[88],"tags":[407,636,321,4916],"class_list":["post-4934","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-chef","tag-chef","tag-chef-client","tag-mode","tag-why-run"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to run chef-client in why-run mode aka \u201cno-operation\u201d - 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\/how-to-run-chef-client-in-why-run-mode-aka-no-operation\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to run chef-client in why-run mode aka \u201cno-operation\u201d - scmGalaxy\" \/>\n<meta property=\"og:description\" content=\"why-run mode is a way to see what the chef-client would have configured, had an actual chef-client run occurred. This [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-run-chef-client-in-why-run-mode-aka-no-operation\/\" \/>\n<meta property=\"og:site_name\" content=\"scmGalaxy\" \/>\n<meta property=\"article:published_time\" content=\"2018-05-02T09:36:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-02-27T09:07:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/05\/chef-client-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"600\" \/>\n\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\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\\\/how-to-run-chef-client-in-why-run-mode-aka-no-operation\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-run-chef-client-in-why-run-mode-aka-no-operation\\\/\"},\"author\":{\"name\":\"scmgalaxy K\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\"},\"headline\":\"How to run chef-client in why-run mode aka \u201cno-operation\u201d\",\"datePublished\":\"2018-05-02T09:36:20+00:00\",\"dateModified\":\"2021-02-27T09:07:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-run-chef-client-in-why-run-mode-aka-no-operation\\\/\"},\"wordCount\":168,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-run-chef-client-in-why-run-mode-aka-no-operation\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2018\\\/05\\\/chef-client-1.jpg\",\"keywords\":[\"Chef\",\"Chef Client\",\"mode\",\"why-run\"],\"articleSection\":[\"Chef\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-run-chef-client-in-why-run-mode-aka-no-operation\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-run-chef-client-in-why-run-mode-aka-no-operation\\\/\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-run-chef-client-in-why-run-mode-aka-no-operation\\\/\",\"name\":\"How to run chef-client in why-run mode aka \u201cno-operation\u201d - scmGalaxy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-run-chef-client-in-why-run-mode-aka-no-operation\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-run-chef-client-in-why-run-mode-aka-no-operation\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2018\\\/05\\\/chef-client-1.jpg\",\"datePublished\":\"2018-05-02T09:36:20+00:00\",\"dateModified\":\"2021-02-27T09:07:03+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-run-chef-client-in-why-run-mode-aka-no-operation\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-run-chef-client-in-why-run-mode-aka-no-operation\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-run-chef-client-in-why-run-mode-aka-no-operation\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2018\\\/05\\\/chef-client-1.jpg\",\"contentUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2018\\\/05\\\/chef-client-1.jpg\",\"width\":600,\"height\":350},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-to-run-chef-client-in-why-run-mode-aka-no-operation\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to run chef-client in why-run mode aka \u201cno-operation\u201d\"}]},{\"@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":"How to run chef-client in why-run mode aka \u201cno-operation\u201d - 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\/how-to-run-chef-client-in-why-run-mode-aka-no-operation\/","og_locale":"en_US","og_type":"article","og_title":"How to run chef-client in why-run mode aka \u201cno-operation\u201d - scmGalaxy","og_description":"why-run mode is a way to see what the chef-client would have configured, had an actual chef-client run occurred. This [&hellip;]","og_url":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-run-chef-client-in-why-run-mode-aka-no-operation\/","og_site_name":"scmGalaxy","article_published_time":"2018-05-02T09:36:20+00:00","article_modified_time":"2021-02-27T09:07:03+00:00","og_image":[{"width":600,"height":350,"url":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/05\/chef-client-1.jpg","type":"image\/jpeg"}],"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\/how-to-run-chef-client-in-why-run-mode-aka-no-operation\/#article","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-run-chef-client-in-why-run-mode-aka-no-operation\/"},"author":{"name":"scmgalaxy K","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102"},"headline":"How to run chef-client in why-run mode aka \u201cno-operation\u201d","datePublished":"2018-05-02T09:36:20+00:00","dateModified":"2021-02-27T09:07:03+00:00","mainEntityOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-run-chef-client-in-why-run-mode-aka-no-operation\/"},"wordCount":168,"commentCount":0,"image":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-run-chef-client-in-why-run-mode-aka-no-operation\/#primaryimage"},"thumbnailUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/05\/chef-client-1.jpg","keywords":["Chef","Chef Client","mode","why-run"],"articleSection":["Chef"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.scmgalaxy.com\/tutorials\/how-to-run-chef-client-in-why-run-mode-aka-no-operation\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-run-chef-client-in-why-run-mode-aka-no-operation\/","url":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-run-chef-client-in-why-run-mode-aka-no-operation\/","name":"How to run chef-client in why-run mode aka \u201cno-operation\u201d - scmGalaxy","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-run-chef-client-in-why-run-mode-aka-no-operation\/#primaryimage"},"image":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-run-chef-client-in-why-run-mode-aka-no-operation\/#primaryimage"},"thumbnailUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/05\/chef-client-1.jpg","datePublished":"2018-05-02T09:36:20+00:00","dateModified":"2021-02-27T09:07:03+00:00","author":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102"},"breadcrumb":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-run-chef-client-in-why-run-mode-aka-no-operation\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.scmgalaxy.com\/tutorials\/how-to-run-chef-client-in-why-run-mode-aka-no-operation\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-run-chef-client-in-why-run-mode-aka-no-operation\/#primaryimage","url":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/05\/chef-client-1.jpg","contentUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2018\/05\/chef-client-1.jpg","width":600,"height":350},{"@type":"BreadcrumbList","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-to-run-chef-client-in-why-run-mode-aka-no-operation\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.scmgalaxy.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"How to run chef-client in why-run mode aka \u201cno-operation\u201d"}]},{"@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\/4934","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=4934"}],"version-history":[{"count":3,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/4934\/revisions"}],"predecessor-version":[{"id":5020,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/4934\/revisions\/5020"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media\/5019"}],"wp:attachment":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media?parent=4934"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/categories?post=4934"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/tags?post=4934"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}