{"id":9095,"date":"2020-01-21T06:17:43","date_gmt":"2020-01-21T06:17:43","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=9095"},"modified":"2021-11-13T06:57:15","modified_gmt":"2021-11-13T06:57:15","slug":"chef-configuration-management-interview-questions-and-answers-part-5","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/chef-configuration-management-interview-questions-and-answers-part-5\/","title":{"rendered":"Chef Configuration Management Interview Questions and Answers Part \u2013 5"},"content":{"rendered":"\n<p><strong>Why do we make a new cookbook dependent upon one or more different cookbooks?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>So that we don&#8217;t breach copyright<\/li><li>So that we can make use of Berkshelf<\/li><li><strong>So we can avoid having to duplicate code (Ans)<\/strong><\/li><li>So that we can manage a node running Linux<\/li><li>So that we can upload the cookbook to Chef Server<\/li><\/ul>\n\n\n\n<p><strong>Why should we always encrypt credentials which are stored in data bags?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>We cannot create un-encrypted values on Chef Server.<\/li><li><strong>So that we do not expose sensitive passwords in plaintext (Ans)<\/strong><\/li><li>Some cookbooks, like apt, require encrypted credentials.<\/li><li>We don&#8217;t need to encrypt credentials, Chef does this automatically.<\/li><li>Berkshelf will not upload cookbooks containing unencrypted data bag values.<\/li><\/ul>\n\n\n\n<p><strong>Why are hard-coded values in a Chef recipe or template a bad idea?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Some platforms (like Windows) don&#8217;t support hard-coded values.<\/li><li>They increase processing time.<\/li><li>From version 12 onwards, Chef does not support hard-coded values.<\/li><li><strong>They make the code inflexible and not reusable. (Ans)<\/strong><\/li><li>They are a good idea as they reduce processing time.<\/li><\/ul>\n\n\n\n<p><strong>When using the ChefDK to generate a new recipe, do you need to specify the .RB file extension?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Yes, but only if you&#8217;re running Windows.<\/li><li>No, Visual Studio Code does this automatically.<\/li><li>Yes, otherwise you can&#8217;t edit the file.<\/li><li>No, all files in a Chef repository automatically use the .RB file extension.<\/li><li><strong>No, CHEF GENERATE does this automatically. (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>What is Chocolatey?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>It is an open-source package provider for Windows. (Ans)<\/strong><\/li><li>It is a community utility provided with the ChefDK.<\/li><li>It is a platform for running virtual machines.<\/li><li>It is a PowerShell module.<\/li><li>It is the code name for the latest build of Windows 10.<\/li><\/ul>\n\n\n\n<p><strong>Which Test Kitchen provisioner should we use when the target platform is Windows? <\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Vagrant<\/li><li>Gem<\/li><li><strong>Chef Zero Scheduled Task (Ans)<\/strong><\/li><li>Chef Zero<\/li><li>&#8211;local-mode<\/li><\/ul>\n\n\n\n<p><strong>What should you do if &#8220;kitchen converge&#8221; encounters an error?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Use a different Test Kitchen provisioner<\/li><li>Use &#8220;kitchen destroy&#8221;<\/li><li><strong>Remediate the error and run &#8220;kitchen converge&#8221; again (Ans)<\/strong><\/li><li>Nothing &#8211; errors are expected<\/li><li>Upload the cookbook into production<\/li><\/ul>\n\n\n\n<p><strong>How do you specify different attributes so that your cookbook will work with Vagrant\/Test Kitchen?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Use override attributes in the vagrantfile<\/li><li>Create [default][kitchen] attributes in the cookbook&#8217;s default.rb attributes file<\/li><li><strong>Use override attributes in the cookbook&#8217;s .kitchen.yml file (Ans)<\/strong><\/li><li>Chef Zero will automatically modify any attributes needed.<\/li><\/ul>\n\n\n\n<p><strong>How do you use a Chef resource which is defined in a different cookbook?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Use the include_cookbook Chef resource in your own cookbook<\/li><li><strong>Create a dependency on the external cookbook in your cookbook&#8217;s metadata.rb file (Ans)<\/strong><\/li><li>You should always re-create Chef functionality from scratch in each cookbook.<\/li><li>Use GEM INSTALL to download the cookbook to the ChefDK<\/li><\/ul>\n\n\n\n<p><strong>Why do we need to install the WinRM plugin for Vagrant?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>We don&#8217;t &#8211; Vagrant does not support WinRM.<\/li><li><strong>To connect to a Vagrant box running Windows using WinRM (Ans)<\/strong><\/li><li>Because Vagrant talks to VirtualBox using WinRM<\/li><li>To connect to a Vagrant box running Ubuntu using WinRM<\/li><li>So that Vagrant can populate the PATH variable<\/li><\/ul>\n\n\n\n<p><strong>When creating a new Chef role using &#8220;knife role from file&#8221;, in what format should the source file be?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Ruby<\/li><li><strong>JSON (Ans)<\/strong><\/li><li>Erlang<\/li><li>XML<\/li><li>TXT<\/li><\/ul>\n\n\n\n<p><strong>Why is the Chef Server name important?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The server name must be unique as it is accessible over the Internet<\/li><li>The trial license is bound to the server name<\/li><li><strong>The name is written to the server certificate &#8211; if there is a mismatch clients cannot connect (Ans)<\/strong><\/li><li>The Chef Server name isn&#8217;t important at all<\/li><\/ul>\n\n\n\n<p><strong>What describes a technical process which gives the same result each time?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Omnipotent<\/li><li>Impotent<\/li><li><strong>Idempotent (Ans)<\/strong><\/li><li>Potentate<\/li><\/ul>\n\n\n\n<p><strong>When accessing the Chef Management Console via a browser, why might you see a certificate error?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>You forgot to run &#8220;opscode-manage-reconfigure&#8221;<\/li><li><strong>You are using a URL which is different to the Chef server name (Ans)<\/strong><\/li><li>You need to purchase a certificate from a Certificate Authority<\/li><li>The Management Console has been incorrectly installed<\/li><\/ul>\n\n\n\n<p><strong>What do you use to install the Azure PowerShell modules?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Microsoft Web Platform Installer (Ans)<\/strong><\/li><li>sudo apt-get install<\/li><li>Microsoft OneGet<\/li><li>Microsoft Azure CLI<\/li><\/ul>\n\n\n\n<p><strong>We can use SSH to bootstrap the Chef Client onto a Linux node. What do we use for Windows nodes?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>PowerShell<\/li><li>Visual Basic<\/li><li><strong>WinRM (Ans)<\/strong><\/li><li>SSH<\/li><\/ul>\n\n\n\n<p><strong>Why is Git an integral part of using Chef?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Because Chef development is driven by open source principles<\/li><li><strong>Because version control is critical for managing code properly (Ans)<\/strong><\/li><li>The ChefDK needs Git to be installed first<\/li><li>The ChefDK uses Git to upload cookbooks to the Chef Server<\/li><\/ul>\n\n\n\n<p><strong>If one Chef cookbook depends upon another Chef cookbook, where should this dependency be stated?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>In the .gitignore file<\/li><li>In the README.md file<\/li><li><strong>In the metadata.rb file (Ans)<\/strong><\/li><li>In the knife.rb file<\/li><\/ul>\n\n\n\n<p><strong>On which platform is the Azure Command Line Interface (CLI) supported?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>All of them  (Ans)<\/strong><\/li><li>Mac OS X<\/li><li>Microsoft Windows<\/li><li>Linux<\/li><\/ul>\n\n\n\n<p><strong>What does Knife need in order to communicate with the Chef Server?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The URL of the Chef Servercd<\/li><li>User and organization certificates<\/li><li>SSL certificates from the Chef Server<\/li><li><strong>All of these (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>In an environment managed by Chef, where does cookbook and policy authoring happen?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>In the Chef Management Console<\/li><li>On the Chef Server<\/li><li><strong>In the Chef Development Kit (Ans)<\/strong><\/li><li>In the Chef PostgreSQL database<\/li><\/ul>\n\n\n\n<p><strong>What is a provider?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>An entry in the PATH environment variable on a Windows system<\/li><li><strong>A process by which Chef achieves a recipe&#8217;s declared end-state (Ans)<\/strong><\/li><li>A component of a cookbook which defines the version number and dependencies<\/li><li>A self-contained Ruby package, such as knife-windows<\/li><\/ul>\n\n\n\n<p><strong>What does it mean if a Chef node reports an &#8220;empty run list&#8221; during a client run?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>It means that the Chef Client did not install correctly, and must be reinstalled<\/li><li><strong>It means that no recipes, cookbooks, or roles have been assigned to the node (Ans)<\/strong><\/li><li>It means that the wrong recipe, cookbook or role has been assigned to the node<\/li><li>It means that the Chef Client failed to connect to the Chef Server<\/li><\/ul>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_90579\"><iframe loading=\"lazy\"  id=\"_ytid_31022\"  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_90579\"  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>Why do we make a new cookbook dependent upon one or more different cookbooks? So that we don&#8217;t breach copyright So that we can make use of Berkshelf So we&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[88],"tags":[641,407,1518,282,244,482],"class_list":["post-9095","post","type-post","status-publish","format-standard","hentry","category-chef","tag-answers","tag-chef","tag-chef-interview","tag-configuration","tag-management","tag-questions"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9095","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=9095"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9095\/revisions"}],"predecessor-version":[{"id":25034,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9095\/revisions\/25034"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=9095"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=9095"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=9095"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}