Devops
Devops
CERTIFICATE
1
DevOps Lab Manual
Information Technology
Prerequisite(s): Operating System, Virtualization, Cloud Computing, Java and Web Programming,
and Software Engineering & Monitor the Software Applications.
Course Outcomes:
CO 1: Remember the importance of DevOps tools used in software development life cycle
CO 2: Analyse & Illustrate the Containerization of OS images and deployment of applications over
Docker
6. Gigabit Ethernet (GbE) network interface card (NIC CentOS/Fedora/Ubuntu/Redhat Server OS for
One Server)
7. JDK or higher
8. Netbeans or Eclipse
2
9. OpenSSH.
Experiments:
3
Week – 1 Introduction
to DevOps
AIM:
To Understand the Concept of DevOps with related technologies which are used to Code, Build, Test,
Configure & Monitor the Software Applications.
THEORY:
What is DevOps:
The word DevOps is a combination of two words Development and Operations. Before getting
into what DevOps is, let us get an idea about the two teams involved in software development.
The development team is responsible for developing, designing, and building the application.
The operation team deals with the deployment and testing of the application. If there are
problems with the application, the operation team also provides feedback to the development
team. Now let us get to the history of DevOps.
History of DevOps:
2009: In the initial stage the first conference was ”Deploys a day: Dev and Ops cooperation of
flicker.” Another conference called “DevOps Days in Ghent, Belgium” also happened.
2010: DevOps days conference happened in the United States at mount view, calif.
2018: 30 DevOps day conferences were scheduled across the united states.
Need of DevOps:
As we know about the problems faced in traditional models like in the waterfall model there is
a problem of a one-way stream of work. Due to which if there is any mistake the whole process
repeats and there is no interaction with customers. Now, this is solved in agile by splitting the
whole development plan into several iterations for a better level of production efficiency. The
agile model also includes customer interaction with the company to rectify the mistakes. But
there is another problem faced in Agile too.
Here, the problem arises when the development team continuously changes the code for better
performance and sends the code to the operations team for testing. But there may be a delay in
4
the operations team feedback in situations like if the developers sent code for review at night
but due to the unavailability of the operations team, there will be a delay in the project feedback.
So, DevOps is the solution to this problem. DevOps is a practice or a methodology in which the
development team and operations team work together by including automation at the initial
stages. So they can work on rapidly changing systems, fix bugs, and help to deliver a good quality
of software in time.
DevOps Architecture:
Development and operations both play essential roles in order to deliver applications. The
deployment comprises analysing the requirements, designing, developing, and testing of the
software components or frameworks.
The operation consists of the administrative processes, services, and support for the software.
When both the development and operations are combined with collaborating, then the DevOps
architecture is the solution to fix the gap between deployment and operation terms; therefore,
delivery can be faster.
DevOps architecture is used for the applications hosted on the cloud platform and large
distributed applications. Agile Development is used in the DevOps architecture so that
integration and delivery can be contiguous. When the development and operations team works
separately from each other, then it is time-consuming to design, test, and deploy. And if the
terms are not in sync with each other, then it may cause a delay in the delivery. So, DevOps
enables the teams to change their shortcomings and increases productivity.
Below are the various components that are used in the DevOps architecture:
5
1.) Build:
Without DevOps, the cost of the consumption of the resources was evaluated based on the pre -
defined individual usage with fixed hardware allocation. And with DevOps, the usage of cloud, sharing
of resources comes into the picture, and the build is dependent upon the user's need, which is a
mechanism to control the usage of resources or capacity
2.) Code:
Many good practices such as Git enables the code to be used, which ensur es writing the code
for business, helps to track changes, getting notified about the reason behind the difference in
the actual and the expected output, and if necessary reverting to the original code developed.
The code can be appropriately arranged in files, folders, etc. And they can be reused.
3.) Test:
The application will be ready for production after testing. In the case manual testing, it
consumes more time in testing and moving the code to the output. The testing can be
automated, which decreases the time for testing so that the time to deploy the code to
production can be reduced as automating the running of the scripts will remove many manual
steps.
4.) Plan:
DevOps use Agile methodology to plan the development. With the operations and development team
in sync, it helps in organizing the work to plan accordingly to increase productivity.
5.) Monitor:
6
Continuous monitoring is used to identify any risk of failure. Also, it helps in tracking the system
accurately so that the health of the application can be checked. The monitoring becomes more
comfortable with services where the log data may get monitored through many third-party tools
such as Splunk.
6.) Deploy:
Many systems can support the scheduler for automated deployment. The cloud management
platform enables users to capture accurate insights and view the optimization scenario, analytics
on trends by the deployment of dashboards.
7.) Operate:
DevOps changes the way traditional approach of developing and testing separately. The teams
operate in a collaborative way where both the teams actively participate throughout the service
lifecycle. The operation team interacts with developers, and they come up with a monitoring
plan which serves the IT and business requirements.
8.) Release:
Deployment to an environment can be done by automation. But when the deployment is made
to the production environment, it is done by manual triggering. Many processes involved in
release management commonly used to do the deployment in the production environment
manually to lessen the impact on the customers.
7
Week – 2
Introduction to GIT
What is GIT:
Git is a popular version control system. It was created by Linus Torvalds in 2005, and has been
maintained by Junio Hamano since then.
It is used for:
Why GIT ?
What is GitHub ?
8
• GitHub makes tools that use Git.
• GitHub is the largest host of source code in the world, and has been owned by Microsoft since
2018.
• In this tutorial, we will focus on using Git with GitHub.
Step 1: To download the Git installer, visit the Git’s official site and go to download page
Click on the package given on the pages as latest version for windows. The download will start after
selecting the package.
Step 2: Click on the downloaded installer file and select yes to continue. After selecting the yes the
installation begins, and the screen will look like as:
Step3: Default components are automatically selected in this step. You can also choose your required
part.
Step4: The default Git command-line options are selected automatically. You can choose your preferred choice.
Step5: The default transport backend options are selected in this step. Click next to continue.
Step8: This is the last step that provides some extra features like system caching, credential
management and symbolic link. Select the required features and click on the next option.
Therefore, The Git installation is completed. Now you can access the Git Gui and Git Bash.
9
It facilitates with three features.
10
Step1: Start the General OS and Package update
First of all, we should start the general OS and package updates. To do so, run the below command:
$ apt-get update
Now we have started the general OS and package updates. After this, we will run the general
updates on the server so that we can get started with installing Git. To do so, run the following
commands:
The above command will install the Git on your system, but it may ask you to confirm the download
and installation.
To confirm the installation, press 'y' key on the editor. Now, Git is installed and ready to use.
When the central installation done, first check to ensure the executable file is set up and accessible.
The best way to do this is the git version command. It will be run as:
$ git --version
Output:
Now you can start using Git on your system. You can explore many features f the version control
system. To go with Git, you have to configure the initial user access process. It can be done with
the git config command.
Suppose I want to register a us er whose user name is "vishnupriya9141" and email address is
" [email protected] m ", then it will be done as follows:
To register a username, run the below command:
11
To register an email address for the given author, run the below command:
Now, you have successfully registered a user for the version control system.
It's important to understand that the git config tool works on a user according to the user. For
example, if we have a user "john" registered on Git. Then there can be another user "Mike" on
the same machine registered on Git. To do this, Mike must run the same command from his user
account. The commits made by both the users will be done under their details in
Git.
GitHub commands
Command Description
Command Description
Command Description
git branch List branches (the asterisk denotes the
current branch)
git branch –a List all branches (local and remote)
git branch [branch name] Create a new branch
git branch -d [branch name] Delete a branch
12
git push origin --delete [branch name] Delete a remote branch
git checkout -b [branch name] Create a new branch and switch to it
git checkout -b [branch name] Clone a remote branch and switch to it
origin/[branch name]
git branch -m [old branch name] [new Rename a local branch
branch name]
git checkout [branch name] Switch to a branch
git checkout - Switch to the branch last checked out
git checkout -- [file-name.txt] Discard changes to a file
git merge [branch name] Merge a branch into the active branch
git merge [source branch] [target branch] Merge a branch into a target branch
git stash Stash changes in a dirty working directory
git stash clear Remove all stashed entries
Command Description
git log View changes
git log --summary View changes (detailed)
git log –one line View changes (briefly)
git diff [source branch] [target branch] Preview changes before merging
13
a) AIM:
To perform version control on website software using different version control tools like GIT
Theory:
Step 2: Open the new folder in visual studio and open the terminal (Git Bash).
Step 3: To generate SSH key (Server Shell Key) for authentication purpose give the following command.
Enter passphrase:
"C:\Users\hp272 pavilion\.ssh\id_rsa"
14
Your public key has been saved in
“C:\Users\hp272 pavilion\.ssh\id-rsa.pub”
Step 5: Goto public key location and Copy the public key.
Step 6: Now, Go to Git Hub account,go to setting and select SSH key and paste SSH key and save
.
15
Step 7: Now, go to Git Bash and set up global config variables (if we are working with other developers we
need to know who is checking whole code in and out, and to make the changes.
$git config –global user.name “vishnupriya9141”
Clone project
Step 2: To make changes in repository or add new file local machine give the following $git
add “hello.py”
16
Or $git add
Step 4: To push the file from local machine to git to give the following command:
17
$git push
b) AIM:
To commit and push project from eclipse IDE to GIT and GIT to eclipse IDE.
PROCEDURE:
Step 4: Copy the SSH URI of project repository in github and paste it in URI. (For http URI usename
and password need to be given) and click on Next.
18
Step 6: Select Local Destination and click on Finish.
sitories
appears as follow
Step 8: Now, Create a Java project, Enter Project name, and click on Finish
20
Step 9: Now, right click on Project name goto Team and then goto Share Project
Step 10: Now, configure the GIT Repository and click on Finish.
Step 11: Again right click on project and goto Team and (Now you will be shown many options)
goto Commit.
2
Step 12: Now, drag the Unstaged changes to Staged changes and write a Commit Message and
click on Commit and Push.
2
Step 15: Now, click on SRC goto New goto Class.
Step 16: Enter package name and Class name and click on Finish.
Step 17: Type the program and drag the Unstaged changes to Staged changes and write a Commit Message
and click on Commit and Push.
2
c) Aim:
To implement Bit Bucket
Procedure:
2
Step-1: Go to “bitbucket.org” and register.
Step-5: Select clone option and copy the “URL” and select open in VSCODE
Step-6: Install bitbucket extension in Vs Code and open a new folder and then open an integrated
terminal and paste the url with the following command
>git clone <URL>
Set up your App Password : Go to Personal Settings in bitbucket.org and select “Add App Passwords
“ and then copy the password generated by it and save it in your notepad
2
Step-7: After entering the Login Credentials Your repository is successfully cloned in your local VS
CODE
Step-8: Now create a new file “hello.java” and enter a sample java program and add the file to
repository
➢ Git push
2
Step-9: Now if we go back to our bitbucket Account and refresh the page we can see out hello.java
file successfully added and we can apply our required operations.
Output :-
2
Week – 3
Introduction to Jenkins
Jenkins is an open-source automation tool written in Java with plugins built f or Continuous
Integration purposes. Jenkins is used to build and test your software projects continuously
making it easier for developers to integrate changes to the project, and making it easier for users
to obtain a fresh build. It also allows you to continuously deliver your software by integrating
with a large number of testing and deployment technologies.
With Jenkins, organizations can accelerate the software development process through
automation. Jenkins integrates development life-cycle processes of all kinds, including build,
document, test, package, stage, deploy, static analysis, and much more.
Jenkins achieves Continuous Integration with the help of plugins. Plugins allow the integration of
Various DevOps stages. If you want to integrate a particular tool, you need to install the plugins for
that tool. For example Git, Maven 2 project, Amazon EC2, HTML publisher etc.
The image below depicts that Jenkins is integrating various DevOps stages:
There are certain things about Jenkins that separates it from other the Continuous Integration tool. Let us
take a look on those points.
Features of Jenkins:
The following are some facts about Jenkins that makes it better than other Continuous Integration tools:
• Adoption: Jenkins is widespread, with more than 147,000 active installations and over 1
million users around the world.
• Plugins: Jenkins is interconnected with well over 1,000 plugins that allow it to integrate with
most of the development, testing and deployment tools.
It is evident from the above points that Jenkins has a very high demand globally. Before we dive into Jenkins
it is important to know what is Continuous Integration and why it was introduced.
Installation of Jenkins
Step 2: Download the Generic Java Package (war) file after download
Step 3: Check whether Java is downloaded or not. To check wether java is installed or not enter
following command
2
Java -version
Step 4:Open command prompt and run as Administrator and Enter the following net
start jenkins
2
Step 5: To access the Jenkins open the browser and type
localhost:8080
Step 6: Now,it ask you the administrator password and the location is given goto the location
and copy the password and paste it here
30
Step 7:Now, you can see Customize Jenkins.In order to work with jenkins you need to install the
plugins can install suggest plugins or select plugins to install.
Step 9: Now, It ask you to enter username ,password confirm password fullna me and email
address. Click on save and continue
Step 10: Now, Instance Configuration is asked Jenkins is running on localport a nd click on save
and finish
3
Step 11: Now, Jenkins is ready click on start using Jenkins.
a) AIM:
Procedure:
Step 4:In Source Code Management select none.In Build select Execute Windows batch
command.Enter the commands as path of the project and commands to execute the project
and then click on save and apply.
3
Step 6: click on the Console Output to check the whether the output iscorrect or any error is
occurred
3
b) AIM:
Step 3: Enter an item name and select Free style project and click on ok.
Step 4: In General select GitHub project in it copy the URL of the GitHub account and paste it
in Project URL
Step 5: In Source Code Management select GIT in it copy the URL of the repository and paste
it in Repository URL.
3
Step 6: Select Branches to Build in default as master or you can select as your wish.
Step 7: In Build Triggers select Poll SCM in schedule type the numbers with space or you can
type the * instead and then click pn apply and save.
3
Step 8: Click on Build now and then click on Console output
Pipeline in Jenkins
Step 3: Enter an item name and select Free style project and click on ok.
Step 4: In General select GitHub project in it copy the URL of the GitHub account and paste it
in Project URL
40
Step 5: In Source Code Management select GIT in it copy the URL of the repository and paste
it in Repository URL.
Step 6: Select Branches to Build in default as master or you can select as your wish.
40
Step 9: Enter an item name and select Free style project and click on ok.
Step 10: In General select GitHub project in it copy the URL of the GitHub account and paste it
in Project URL
Step 11: In Source Code Management select GIT in it copy the URL of the repository and paste it
in Repository URL.
41
Step 12: Select Branches to Build in default as master or you can select as your wish.
Step 13: Select Build after other projects are built. Enter item name of build and select trigger
only if build is stable
42
Step 16: click on Build now and Console output
Step 17: Enter an item name and select releaseproject and click on ok.
43
Step
18: In General select GitHub project in it copy the URL of the GitHub account and paste it
in Project URL
Step 19: In Source Code Management select GIT in it copy the URL of the repository and paste
it in Repository URL.
Step 20: Select Branches to Build in default as master or you can select as your wish.
44
Step
21: Select Build after other projects are built. Enter item name of deploy and select trigger
only if build is stable
45
Step
25: Enter an item name and select maven project and click on ok.
Step 26: In General select GitHub project in it copy the URL of the GitHub account and paste it
in Project URL
Step 27: In Source Code Management select GIT in it copy the URL of the repository and paste
it in Repository UR
46
Step
Step 28: Select Branches to Build in default as master or you can select as your wish.
47
Step 29: Select Build after other projects are built. Enter item name of testand select trigger only
if build is stable
48
Step 33: Go to new view enter view name and select build pipeline and click on ok.
Step 35: In Trigger Options enter Standard build cards in Build Cards Enter
the options as No
Step 36: In Display Options, No Of displays build are 1 and remaining as shown and click on
Apply and Ok
Step 37:Now, dashboard appear as :
50
4
Introduction to Maven
complete build lifecycle framework. Development team can automate the project's build
infrastructure in almost no time as Maven uses a standard directory layout and a default build
lifecycle.
In case of multiple development teams environment, Maven can set-up the way to work as per
standards in a very short time. As most of the project setups are simple and reusable, Maven
makes life of developer easy while creating reports, checks, build and testing automation setups.
Maven provides developers ways to manage the following −
• Builds
• Documentation
• Reporting
• Dependencies
• SCMs
• Releases
• Distribution
• Mailing list
Features of Maven:
• Simple project setup that follows best practices.
• Consistent usage across all projects.
• Dependency management including automatic updating.
• A large and growing repository of libraries.
• Extensible, with the ability to easily write plugins in Java or scripting languages.
o In TestNG, annotations are easier to understand than Junit. o It produces the HTML
reports for implementation. o It also generates the Logs.
52
o In TestNG, there is no constraint available such as @beforeclass and @afterclass which
is present in Junit.
o TestNG enables you to group the test cases easily which is not possible in JUnit.
o TestNG supports three additional levels such as @Before/After suite, @Before/AfterTest,
and Before/AfterGroup. o TestNG does not extend any class. TestNG framework allows
you to define the test cases where each test case is independent of other test cases.
o It allows you to run the test cases of a particular group. Let's consider a scenario where
we have created two groups such as 'Smoke' and 'Regression'. If you want to execute the
test cases in a 'Regression' group, then this can only be possible in the TestNG framework.
o Parallel execution of test cases, i.e., running multiple test cases is only possible in the
TestNG framework.
Procedure:
53
Step 3:goto central and maven and copy the dependencies
AIM:
Procedure:
54
Step 2: Open Dashboard and select New item.
Step 3: Enter an item name and select Maven project and click on ok.
Step 5: Enter the group id and artifact id and finish. These are identifiers of our project
55
Step 6: Now, to use Test NG we should go to maven repository search for testing.
Step 8: Select the latest version and copy the dependency code. Paste the
dependencies
56
Step 9: click on new and the other
Step 11: enter name and modifiers and method stubs you want to create and then click on finish
57
Step 12: create a sample program.
58
Step
13: right click and click on run as and then click on maven test.
59
Step
Week -4
AIM:
To install docker and perform some basic commands.
Introduction
Docker
Docker takes away repetitive, mundane configuration tasks and is used throughout the
development lifecycle for fast, easy and portable application development – desktop and cloud.
Docker’s comprehensive end to end platform includes UIs, CLIs, APIs and security that are
engineered to work together across the entire application delivery lifecycle.
Build
• Get a head start on your coding by leveraging Docker images to efficiently develop your
own unique applications on Windows and Mac. Create your multi-container application
using Docker Compose.
• Integrate with your favourite tools throughout your development pipeline – Docker
works with all development tools you use including VS Code, CircleCI and GitHub.
• Package applications as portable container images to run in any environment
consistently from on-premises Kubernetes to AWS ECS, Azure ACI, Google GKE and
more.
Share
• Leverage Docker Trusted Content, including Docker Official Images and images from
Docker Verified Publishers from the Docker Hub repository.
• Innovate by collaborating with team members and other developers and by easily
publishing images to Docker Hub.
• Personalize developer access to images with roles based access control and get insights
into activity history with Docker Hub Audit Logs.
Run
• Deliver multiple applications hassle free and have them run the same way on all your
environments including design, testing, staging and production – desktop or cloud-
native.
• Deploy your applications in separate containers independently and in different
languages. Reduce the risk of conflict between languages, libraries or frameworks.
• Speed development with the simplicity of Docker Compose CLI and with one command,
launch your applications locally and on the cloud with AWS ECS and Azure ACI.
Procedure:
Step 1:To install and work with docker virtualisation should be turned on. It will be avaliable in
Bion virtualization.
60
2: Install.exe file from
docs.docker.com/windows/install
61
Step
62
8: to login click on sign up
Step 9: enter name email and give password accept the terms and click on sign up
Docker Commands
Docker version:
Docker pull:
Tags are used to identify images inside a repository . if we don’t specify a tag docker engine uses
the latest tag by default
Docker images:
We may have many images running in our machine to list all the running docker images is used.
The output list is running images with attributes repository,tags,image,id,created days since
(related),size
64
65
Week – 5
a) AIM:
Procedure:
65
Step 4: right click and click on new and then on class
66
Step 6: write a sample program
Step 7: right click on the program click on run as and then as java application
67
Step 8: open the console to see the output
Step 9: now, launch the terminal and check the docker version
68
docker --v
ersion
69
Step 10: right click on the project and then new and click on file
70
step 12: click yes
7
docker run helloworld:v1
b) AIM:
To dockerize python application Procedure:
Step 3: In that folder create a Dockerfile and type the code as shown below:
7
Step 4: In the same folder create a python file and type the code as shown below:
Step 5: And also create txt file in same folder and type the code as shown below:
The txt file name should match the name present in the docker code.
Step 6: To run these file open terminal in VS Code and enter the command:
Docker build -t pythonapp .
7
Step 7: If open the docker the we can see:
c) AIM:
To dockerize html application
Procedure:
Step 3: In that folder create a Dockerfile and type the code as shown below:
Step 4: In the same folder create a html file and type the code as shown below:
7
Step 5: To run these file open terminal in VS Code and enter the command:
Docker build -t myhtml1 docker
images
7
7
Week-6
Ansible Experiment
VS Code is a source code editor that runs on your desktop and is available for Windows, macOS, and Linux.
Utilizing the Ansible VS Code extension capitalizes on VS Code's widespread adoption and sophisticated
ecosystem, offering an integrated environment where developers can efficiently write, run, and debug
Ansible content. The extension harnesses VS Code's editing, navigation, and debugging tools tailored for
Ansible to ease content development, making it a logical choice for automation.
When the extension is installed for the first time, the runtime status is "Not yet activated" which indicates that
the extension is not yet running. The status will be activated only after a file is opened in the editor and the
language identified for the file is Ansible.
For Windows users, the extension works with WSL2 and not on native Windows.
The Ansible extension supports multiple configuration options. This allows the user to, for instance, change the
executable path for Ansible, ansible-lint, the Python interpreter, and so on. There is also an option to enable
the automation execution environment. Users can choose the container engine, image name, pull policy, and
more.
7
To see and change the configuration options in the VS Code window, go to Code -> Settings/Preference ->
Settings and in the Search settings box (Figure 2), type ansible.
You can set preferences for a given user or workspace, and depending on the environment, also for remote
type and workspace folder. User-based settings are applied globally for any instance of VS Code that is
opened. Workspace settings are stored within your workspace and only apply when the current workspace is
opened. Alternatively, for workspace settings, you can also provide the Ansible settings by editing
the .vscode/settings.json file within the workspace root folder (Figure 3).
7
The choice between workspace settings and userspace (user settings) in VS Code depends on the context and
needs of your projects. Here's why you might consider workspace settings to be better in certain scenarios:
• Project-specific configuration: Workspace settings are stored with your Ansible project, allowing you
to define and maintain configurations that are specific to that project. This means that any special
settings or extensions needed for the project won't interfere with your general VS Code environment or
other Ansible projects.
• Team collaboration: When working on a shared project, workspace settings help ensure consistency
across different team members' environments. By committing workspace settings to your version
control system, you can make sure every team member has the same configuration, reducing "works on
my machine" problems.
• Avoiding configuration conflicts: By using workspace settings, you can avoid conflicts between
Ansible project-specific configurations and your personal preferences in the user settings.
• Flexibility and control: Workspace settings provide flexibility, allowing you to switch between
different projects with their unique configurations seamlessly. You can have different settings for a
Python project, an Ansible project, and a C++ project, each optimized for the respective stack without
the need to manually reconfigure settings each time you switch projects.
Now that you've installed the Ansible extension in VS Code, the next step is to either open an Ansible project
or create a new Ansible playbook project.
7
4. Additionally, in VS Code, you can add persistent file association for language to settings.json files like
this:
5. { 6.
...
7.
8. "files.associations": {
9. "*plays.yml": "ansible",
10. "*init.yml": "yaml",
11. }
12. }
Copy snippet
13. You can also manually associate the Ansible language to the file if the file is recognized as a YAML file.
Follow the instructions associated with Figure 5.
14. Hover the cursor on the language identified (YAML in this case) in the bottom right corner. You will see
Select Language Mode
15. Type Ansible in the tab and then select it. After doing this, the identified language for the file is changed
to Ansible (Figure 6).
16. When a file is recognized as Ansible, the Ansible VS Code extension provides specific features for
creating Ansible playbooks and task files, such as auto-completion, hover, diagnostics, goto, and more.
The extension also relies on the Red Hat vscode-yaml extension to provide auto-completion and
diagnostics information of other related files like Ansible vars files, ansible-navigator settings files,
ansible-galaxy requirements and metafiles, ansible-lint configuration files, and other YAML files.
7
Week - 7
A set of tools is provided with Ansible Automation Platform to help automation creators to create, test, and
deploy collections containing playbooks, roles, modules, and plugins.
These packages are available via the Ansible Automation Platform setup bundle as RPM packages. The Red Hat
recommended way is to set up these tools as part of your Python virtual environment inside the Ansible project
workspace. First, install these RPM packages using the steps below. 1. Open the terminal in VS Code. Go to
Copy snippet
7
Info alert: Make sure the Python interpreter used to initialize the virtual environment is the same as
the system default. You can run the pip freeze | grep ansible command to check if all required
developer tools are part of your virtual environment.
9. Point the Python interpreter in VS Code to the one in the virtual environment. This ensures that all the
required developer tooling comes from the correct location.
10. Now you can start working on your Ansible project using the Ansible VS Code extension
To list the automation execution environments supported by the extension, open the VSCode settings (Code ->
Settings/Preferences -> Settings) and type ansible.execution environment (Figure 8).
7
Info alert:Alternatively, you can click the Ansible extension in the extension marketplace and then click the
gear icon to open the extension settings. See Figure 9.
After enabling the execution environment (EE), the extension will pull the ghcr.io/ansible/creator- ee:latest
image by default, if it is not present locally. The value of the image can be changed by providing the intended
value for ansible.executionEnvironment.image setting. After the EE pull is successful, the Ansible extension will
copy the plug-ins docs from within EE to the local cache folder and it will be used to provide autocompletion,
hover and goto functionality. Since the creator-ee image has ansible-lint bundled, the Ansible extension and
ansible-language-server will volume mount the entire workspace within the EE and run ansible-lint or ansible-
playbook-syntax- check based on settings to provide diagnostics information in editor.
7
VIVA QUESTIONS
1. What is DevOps?
9. What are the various branching strategies used in the version control system?
10. Can you say something about the DevOps pipeline?