Chef DevOps Interview Questions
Following are some of the most frequently asked Chef Devops interview questions in the interview, here are the answers for them.
What is chef in devops?
Chef is a configuration management tool for dealing with machine setup on physical servers, virtual machines and in the cloud.
What is a Node in Chef?
A Node represents a server and is typically a virtual machine, container instance, or physical server – basically any compute resource in your infrastructure that is managed by Chef.
What is chef in automation?
Chef is a powerful automation platform that transforms infrastructure into code.s The Chef server acts as a hub for configuration data.
What is a chef server?
The Chef server acts as a hub for configuration data. The Chef server stores cookbooks, the policies that are applied to nodes, and metadata that describes each registered node that is being managed by Chef. Nodes use the Chef client to ask the Chef server for configuration details, such as recipes, templates, and file distributions.
Why do we use SSL Certificates in chef?
An SSL certificate is used between the chef-client and the Chef server to ensure that each node has access to the right data.
What is SSL_CERT_FILE in chef?
Use the SSL_CERT_FILE environment variable to specify the location for the SSL certificate authority (CA) bundle that is used by the chef-client.
What is knife ssl check command in chef?
Run the knife ssl check subcommand to verify the state of the SSL certificate, and then use the reponse to help troubleshoot issues that may be present.
What is chef resources file?
A file resource is used to manage files directly on a node.
A file resource block manages files that exist on nodes. For example, to write the home page for an Apache website:
file ‘/var/www/customers/public_html/index.php’ do
content ‘<html>This is a placeholder for the home page.</html>’
Interested in mastering Chef DevOps Training? Enroll now for FREE demo on Chef DevOps Training
What are Data Bags?
A data bag is a global variable that is stored as JSON data and is accessible from a Chef server. A data bag is indexed for searching and can be loaded by a recipe or accessed during a search.
What is chef_acl resource in chef?
Use the chef_acl resource to interact with access control lists (ACLs) that exist on the Chef server.
Syntax: The syntax for using the chef_acl resource in a recipe is as follows:
chef_acl ‘name’ do
attribute ‘value’ # see properties section below
action :action # see actions section below
What information do you need in order to bootstrap in Chef?
Just mention the information you need in order to bootstrap:
Your node’s host name or public IP address.
A user name and password you can log on to your node with.
Alternatively, you can use key-based authentication instead of providing a user name and password.
What is the command you use to upload a cookbook to the Chef server?
You can directly mention the command to upload a cookbook to the Chef server “knife cookbook upload”.
What is run-list in Chef?
run-list lets you specify which Recipes to run, and the order in which to run them. The run-list is important when you have multiple Cookbooks, and the order in which they run matters.
Depending on the discussion if you think more explanation is required just mention the below points
A run-list is:
An ordered list of roles and/or recipes that are run in the exact order defined in the run-list; if a recipe appears more than once in the run-list, the chef-client will not run it twice.
Always specific to the node on which it runs; nodes may have a run-list that is identical to the run-list used by other nodes.
Stored as part of the node object on the Chef server.
Maintained using knife, and then uploaded from the workstation to the Chef server, or is maintained using the Chef management console.
How do you apply an updated Cookbook to your node in Chef?
There are three ways to apply an updated Cookbook to a node you can mention all or any one, I will suggest you to mention all three:
-Run knife ssh from your workstation.
-SSH directly into your server and run chef-client.
-You can also run chef-client as a daemon, or service, to check in with the Chef server on a regular interval, say every 15 or 30 minutes.
Write a service Resource that stops and then disables the httpd service from starting when the system boots in Chef?
Use the below Resource to stop and disable the httpd service from starting when system boots.
service ‘httpd’ do
action [:stop, :disable]
Are these two Chef recipes the same?
service ‘httpd’ do
action [:enable, :start]