0% found this document useful (0 votes)
3 views7 pages

Understanding DevOps and Chef Data Bags

The document discusses various topics related to DevOps and Chef, including the definition of DevOps, the concept of data bags in Chef, and how to create and manage them. It also covers the Maven build lifecycle and Git commands, as well as Docker architecture and setting up a Chef workstation. Additionally, it touches on Maven dependencies and the importance of Linux OS in DevOps.

Uploaded by

Ulfa Peerzade
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views7 pages

Understanding DevOps and Chef Data Bags

The document discusses various topics related to DevOps and Chef, including the definition of DevOps, the concept of data bags in Chef, and how to create and manage them. It also covers the Maven build lifecycle and Git commands, as well as Docker architecture and setting up a Chef workstation. Additionally, it touches on Maven dependencies and the importance of Linux OS in DevOps.

Uploaded by

Ulfa Peerzade
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Q2) a) What is DevOPs?

[5]

Answer:-

b) What are some technical and business benefits of DevOps work culture? [5]

Answer:-

OR

a) What is a data bag in chef ? [5]

Answer:- Chef Server provides a way to store shared, global data between nodes using data bags.

*A data bag is a container for items that represent information about your infrastructure that is not
tied to a single node.

* Data bags contain information that needs to be shared among more than one node.

*Data bags are the only built-in mechanism Chef provides to store and access shared data between
nodes.

*For example:-Shared passwords

License keys for software installs

Shared lists of users and groups

*Chef provides no mechanism to share data between nodes, as shown in FigureÂ

*Each data bag contains a list of items.

*Each item is a JSON-formatted name-value pair collection expected to have exactly the same
schema for every item in the data bag.

*However, the schema between two different data bags can differ. String values are quoted; integer
values are not
b) Explain how to create and manage data bags?

Answer :- A data bag can be created in two ways: using knife or manually. In
general, using knife to create data bags is recommended, but as long as the data
bag folders and data bag item JSON files are created correctly, either method is
safe and effective.

Manually
One or more data bags and data bag items can be created manually under
the data_bags directory in the chef-repo. Any method can be used to create the data bag
folders and data bag item JSON files. For example:

Copy
mkdir data_bags/admins

would create a data bag folder named “admins”. The equivalent command for using knife
is:

Copy
knife data bag create admins

A data bag item can be created manually in the same way as the data bag, but by also
specifying the file name for the data bag item (this example is using vi, a visual editor for
UNIX):

Copy
vi data_bags/admins/[Link]

would create a data bag item named “[Link]” under the “admins” sub-directory in
the data_bags directory of the chef-repo. The equivalent command for using knife is:

Copy
knife data bag create admins charlie

Q3) How do you configure a Git repository to run code sanity checking tools right before making
commits and preventing them if test fails? [10]

OR

Write and explain different phases of maven build life cycle. [10]

Answer:- Maven is a powerful project management tool that is based on POM (project object model)

*It is used for project build, dependency, and documentation.

*It is a tool that can be used for building and managing any Java-based project

* Maven makes the day-to-day work of Java developers easier and helps with the building and
running of any Java-based project.
*Maven Lifecycle: Below is a representation of the default Maven lifecycle and its 8 steps: Validate,
Compile, Test, Package, Integration test, Verify, Install, and Deploy.

[Link]: This step validates if the project structure is correct. For example – It checks if all the
dependencies have been downloaded and are available in the local repository.

[Link]: It compiles the source code, converts the .java files to .class, and stores the classes in the
target/classes folder

[Link]: It runs unit tests for the project

[Link]: This step packages the compiled code in a distributable format like JAR or WAR

[Link] test: It runs the integration tests for the project.

[Link]:This step runs checks to verify that the project is valid and meets the quality standards

[Link]: This step installs the packaged code to the local Maven repository.

[Link]: It copies the packaged code to the remote repository for sharing it with other developers

Q4) a) Explain in detail, Node in Chef. [5]

Answer:- They are the actual machines which are going to be managed by the Chef server.

* All the nodes can have different kinds of setup as per requirement.

* Chef client is the key component of all the nodes, which helps in setting up the communication
between the Chef server and Chef node.

*The other components of Chef node is Ohai, which helps in getting the current state of any node at
a given point of time.
b) Explain the use of following GIT commandsgit add, git branch, git pull, git push, git clean [5]

Answer:-

1. Git add
This command is used to add one or more files to staging (Index) area.

Syntax

To add one file

$ git add Filename

To add more than one file

$ git add*

2. Git branch

This command lists all the branches available in the repository.

Syntax

$ git branch

3. Git pull
Pull command is used to receive data from GitHub. It fetches and merges
changes on the remote server to your working directory.

Syntax

$ git pull URL

4. Git push
It is used to upload local repository content to a remote repository. Pushing is an act of
transfer commits from your local repository to a remote repo. Pushing is capable of
overwriting changes, and caution should be taken when pushing.

Git push command can be used as follows.

Git push origin master

This command sends the changes made on the master branch, to your
remote repository.

Syntax

1. $ git push [variable name] master

Git push -all

This command pushes all the branches to the server repository.

Syntax
1. $ git push --all

5. Git Clean
The Git Clean command is used to clean the untracked files in the repository. When developers
want to remove the untracked files in the working repository then this command is very helpful
to them.
 git clean -n
Using “git clean -n”

 Using “git clean –force”

OR

a) Explain Docker architecture in detail with diagram. [5]

Answer:- Docker Architecture

Below is the simple diagram of a Docker architecture.

b) How to setup chef workstation? [5]


Answer:- On Windows Machine
Step 1 − Download the setup .msi file of chefDK on the machine.
Step 2 − Follow the installation steps and install it on the target location.
The setup will look as shown in the following screenshot.

ChefDK Path Variable


$ echo $PATH
/c/opscode/chef/bin:/c/opscode/chefdk/bin:

Q5) a) What are maven dependencies? [5]

Answer:-

b) Why Linux OS is more important to use in DevOps? [5]

OR

a) What are the fundamental differences between DevOps and Agile? [5]

Answer:-

b) Explain what is a distributed VCS?

Answer:-

You might also like