Chef Configuration Management Interview Questions and Answers Part – 3

What is a resource?

  • Read-only data identified by a type and a name.
  • A description of some piece of a system and its desired state. – ANS
  • An ordered series of configuration states.

What is a recipe?

  • A file that groups related resources. – ANS
  • A file that configures the chef-client run.
  • A file that configures your workstation.

What happens when you don’t specify a resource’s action?

  • You get an error message but the chef-client run continues.
  • You get an error message and the chef-client run halts.
  • The default action is assumed. – ANS

What does the code package ‘httpd’ mean?

  • It identifies a package resource. – ANS
  • It tags the system as a web server.
  • It is incomplete and will cause an error message.

What determines when Chef applies resources?

  • The order of their precedence.
  • The order of their attributes.
  • The order they’re listed in a recipe. – ANS

When must you list a resources attributes?

  • Immediately after the resource name.
  • Immediately after the actions.
  • You can list them anywhere within the resource block. – ANS

What does a cookbook do?

  • It includes recipes and external information and makes them easier to manage. – ANS
  • It includes only external information, such as templates, and makes them easier to manage.
  • It includes only recipes and makes them easier to manage.

What is a run-list?

  • A run-list specifies which recipes to run.
  • A run-list specifies which recipes to run and the order in which to run them. – ANS
  • A run-list specifies which cookbooks to run.

What does test and repair mean?

  • Chef applies changes only when they are necessary. – ANS
  • Chef always applies changes and then tests to see if they are correct.
  • Chef repairs incorrect states and then tests to see if they are now correct.

What language are compliance tests written in:

  • InSpec. – ANS
  • Chef.
  • Ruby.

What cookbook can be used to send compliance data to compliance server during a chef-client run?

  • Compliance cookbook.
  • InSpec cookbook.
  • Audit cookbook. – ANS

Where are compliance profiles stored?

  • On target nodes.
  • On Chef Automate Compliance server. – ANS

Test Kitchen:

  • Lets you run your cookbooks in temporary environments. – ANS
  • Manages the virtual machines you use for temporary environments.
  • Makes it easier to work with the hypervisor that manages the virtual machines.

Which of these commands generates the .kitchen.yml file?

  • kitchen cat .kitchen.yml
  • file ‘/.kitchen.yml’
  • chef generate cookbook – ANS

Which of these commands directs Test Kitchen to add a temporary environment?

  • kitchen make
  • kitchen create – ANS
  • kitchen build

The kitchen converge command:

  • Runs chef-client on the instance. – ANS
  • Runs automated tests on the instance.
  • Downloads the latest version of the provisioner.

Which command gets rid of unwanted instances?

  • kitchen delete
  • kitchen clean
  • kitchen destroy – ANS

What is the advantage to using Test Kitchen?

  • You can find problems earlier in the development process. – ANS
  • It’s an alternative to using a testing environment in the deployment pipeline.
  • It’s an alternative to using another testing framework such as Bats or InSpec.

You’ve fixed an error in your cookbook and want to rerun it using Test Kitchen. Which command do you use?

  • kitchen converge – ANS
  • kitchen verify
  • kitchen repair
Rajesh Kumar
Follow me