0% found this document useful (0 votes)
21 views

Course Report

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

Course Report

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

A SUMMER INTERNSHIP REPORT

on

“Red Hat Enterprise Linux Automation with


Ansible “

Submitted in partial fulfillment of the requirements


of the degree of Bachelor of Technology

By

RATLAVATU VAMSI NAIK

(ID NO : O170435)

Supervisor (s):

Redhat Training and Certification

(DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING)

RAJIV GANDHI UNIVERSITY OF KNOWLEDGE TECHNOLOGIES-AP


ONGOLE CAMPUS
(2023)

1
Approval Sheet
This thesis/dissertation/report entitled (Title) by (Author Name) is approve
for the degree of (Degree details).

Examiner(s)

Supervisor(s)

Chairman

Date :

Place :

2
RAJIV GANDHI UNIVERSITY OF KNOWLEDGE
TECHNOLOGIES
(RGUKT) Ongole,
DEPARTMENT OF COMPUTER SCIENCE AND
ENGINEERING

CERTIFICATE

This is to certify that this summer internship entitled Red Hat


Enterprise Linux Automation With Ansible is the bonafide work of
RATLAVATU VAMSI NAIK in third year B.Tech in Computer science and
engineering of RGUKT Ongole Campus of Rajiv Gandhi University of
Knowledge Technologies (RGUKT), Andhra Pradesh carried out under my
supervision in partial fulfillment of the requirements for the award of
BACHELOR IN COMPUTER SCIENCE ANDENGINEERING during the academic
year 2021-2022.

Supervisor Head of the Department

3
Declaration

I declare that this written submission represents my ideas in my


own words and where others' ideas or words have been included, I
have adequately cited and referenced the original sources. I also
declare that I have adhered to all principles of academic honesty and
integrity and have not misrepresented or fabricated or falsified any
idea/data/fact/source in my submission. I understand that any
violation of the above will be cause for disciplinary action by the
Institute and can also evoke penal action fromthe sources which have
thus not been properly cited or from whom proper permission has
not been taken when needed.

(Signature)

(Name of the student)

(Roll No.)

Date:

4
Acknowledgement

First I would like to express our special thanks of


gratitude to our supervisor Red Hat Trainings and
Certifications for their guidance and support in
completing the project. This was a great experience I
can learn from. It helped me to explore my skills
and increased my interest in DevOps Engineering.

I would also like to extend gratitude to a few of our


friends for helpingus in a few tedious moments while
working on the project.

5
CERTIFICATE OF COMPLETION

6
ABSTRACT

Ansible is an open-source software provisioning, configuration


management, and application-deployment tool. It includes its
own declarative language to describe system configuration.

Ansible is the simplest solution for configuration management


available. It’s designed to be minimal in nature, consistent,
secure and highly reliable, with an extremely low learning
curve for administrators, developers, and IT managers.

7
CONTENTS

Contents

ACKNOWLEDGEMENT 4

CERTIFICATE OF COMPLETION. 5

ABSTRACT 6

CONTENTS

I.INTRODUCTION 8

II.FUNCTIONS OF ANSIBLE 11

III.PROJECT REPORT 17

IV.SAMPLE SCREEN IMAGES 25

V.CONCLUSION & FUTURE SCOPE 31

VI.REFERENCES 32

8
INTRODUCTION
Ansible is an open-source automation framework (or platform) used for

IT tasks such as the deployment of software, configuration

management, orchestration of infra services and supply. Automation is

crucial today, with overly complex IT environments that often need to

be scale-up too quickly for system managers and designers to keep

abreast of everything manually. The automation simplifies complex

tasks, allowing developers to concentrate on other tasks that add value

to an organization and not just make developer jobs better managed.

Understanding
It is simple, powerful and agentless. The biggest differentiator between

Ansible and other too lies in the architecture; it works on the “Push”

model, i.e. no additional software is required to be installed in the

server. By default it manages remote connections over SSH (Linux &

Unix) or WinRM (windows).

9
Below is the Architecture diagram of Ansible:

Architecture components :

Here, we will discuss the architecture part and will discuss its
components. The Ansible automation engine consists of various
components as described below as follows.

 Inventories –
Ansible inventories are lists of hosts with their IP addresses,
servers, and databases which have to be managed via an SSH
for UNIX, Linux, or Networking devices, and WinRM for
Windows

 APIs –
Application Programming Interface or APIs are used as a mode
of transport for public and private cloud services.

 Modules –
Modules are executed directly on remote hosts through
playbooks and can control resources like services, packages,
files, or execute system commands. They act on system files,
install packages and make API calls to the service network.
There are over 450 Ansible that provide modules that automate
1
0
various jobs in an environment. For example, Cloud Modules
like Cloud Formation create or delete an AWS cloud formation
stack.

 Plugins –
Plugins are pieces of code that augment Ansible’s core
functionality and allow executing Ansible tasks as a job build
step. Ansible ships with several handy plugins and one can
also write it on their own. For example, Action plugins act as
front-ends to modules and can execute tasks on the controller
before calling the modules themselves.

 Networking –
Ansible uses a simple, powerful, and agent-less automation
framework to automate network tasks. It uses a separate data
model and spans different network hardware.

 Hosts –
Hosts refer to the nodes or systems (Linux, Windows, etc)
which are automated by Ansible.

 Playbooks –
Playbooks are simple files written in YAML format which
describe the tasks to be executed by Ansible. Playbooks can
declare configurations, orchestrate the steps of any manual
ordered process and can also launch various tasks.

 CMDB –
It stands for Configuration Management Database (CMDB). In
this, it holds data to a collection of IT assets, and it is a
repository or data warehouse where we will store this kind of
data, and It also defines the relationships between such
assets.

 Cloud –
 It is a network of remote servers hosted on the internet to store,
manage and process data instead of storing it on a local server.

Functions of ANSIBLE

1
1
 Ansible automation engine encompasses an Inventory, API, modules,

and plugins.

 Ansible Playbook: It leverages the playbook for automation and

orchestration of IT infrastructure. This playbook consists of an

automation task that serves as an input to the ansible automation engine,

which describes how a particular piece of automation will work.

 This playbook consists of a series of “play”, which defines the

automation task across a set of hosts known as “Inventory”. Each ‘play’

consists of multiple tasks that can serve one or more hosts present in the

inventory. All these tasks made a call to an Ansible module, which is a

small piece of code that performs a specific task.

 A typical example of a task could be installing any software or placing a

configuration file on the server. A more complex task could be spinning

up the entire Cloud Formation infrastructure in Amazon EC2.

 It comes with hundreds of modules ranging from managing network

devices, simple configuration management to modules for maintaining

infrastructure on every cloud provider.

 These modules are designed in such a way that it first checks whether the

task needs to be executed or not; for instance, if an ansible task is to start

a Tomcat server, then the task will only get executed if it is not running

already. This phenomenon is termed as “Idempotency”, which allows

executing configuration repeatedly without any mayhem.

12
 These playbook tasks can also be reused; these reusable units are called

“Role”. These roles can be easily leveraged to perform redundant tasks

such as applying common server configuration across development, UAT

and production servers.

What can you do with Ansible?


With this, you can automate the below-mentioned tasks.

Let’s assume you have a java web application that needs to be

deployed in multiple servers, i.e. dev, UAT and prod. In order to deploy the

war file, first, you need to set up the webserver and database server in all the

machines. Also, the same SQL scripts need to run in all the databases to set

up the database. Now it doesn’t make sense to perform this redundant task

manually.

13
With this, all you need to do is to write simple tasks in the playbook, and

Ansible will perform these redundant tasks for you.

Required Skills

Unlike puppet & chef (automation tool like ansible), which requires

the knowledge of ruby, with ansible, you don’t need to learn any

complicated programming language. Ansible uses YAML, which is a high-

level human-readable language that can be easily understood by IT Admin.

Also, most of the common tasks are available in the form of a playbook in

the Ansible Galaxy Community, which you can extend as per your

requirement.

Why Should we use Ansible?


Now let’s see why we should make use of Ansible in our projects.

 Using this, you can cut down certain processes from hours to minutes.

 It eliminates repetitive tasks.

 It saves time and improves productivity.

 Fewer mistakes and errors.

 Increase accountability and compliance

Getting started with Ansible

14
Ansible automates the management of remote systems and controls
their desired state. A basic Ansible environment has three main
components:

Control node

A system on which Ansible is installed. You run Ansible commands


such as ansible or ansible-inventory on a control node.

Managed node
A remote system, or host, that Ansible controls.

Inventory
A list of managed nodes that are logically organized. You create an
inventory on the control node to describe host deployments to Ansible.

Ready to start using Ansible? Complete the following steps to get up


and running: 15
1. Install Ansible. Visit the installation guide for complete details.
2. python3 -m pip install --user ansible
3. Create an inventory by adding the IP address or fully qualified
domain name (FQDN) of one or more remote systems
to /etc/ansible/hosts . The following example adds the IP addresses
of three virtual machines in KVM:
4. [myvirtualmachines]
5. 192.0.2.50
6. 192.0.2.51
7. 192.0.2.52
8. Verify the hosts in your inventory.
9. ansible all --list-hosts
10. hosts (1):
11. 192.0.2.50
12. 192.0.2.51
13. 192.0.2.52
14. Set up SSH connections so Ansible can connect to the managed
nodes.

a. Add your public SSH key to the authorized_keys file on


each remote system.
b. Test the SSH connections, for example:
15. ssh [email protected]

If the username on the control node is different on the host, you


need to pass the -u option with the ansible command.

16. Ping the managed nodes.


17. ansible all -m ping
18. 192.0.2.50 | SUCCESS => {
19. "ansible_facts": {
20. "discovered_interpreter_python": "/usr/bin/python3"
21. },
22. "changed": false,
23. "ping": "pong"
24. }
25. 192.0.2.51 | SUCCESS => {
26. "ansible_facts": {
27. "discovered_interpreter_python": "/usr/bin/python3"
28. },
29. "changed": false,
30. "ping": "pong"
31. }
32. 192.0.2.52 | SUCCESS => {
33. "ansible_facts": {
34. "discovered_interpreter_python": "/usr/bin/python3"
35. },
36. "changed": false,
37. "ping": "pong"
}

16
PROJECT REPORT

17
18
19
20
21
22
23
24
SAMPLE PROJECT IMAGES

25
26
27
28
29
30
CONCLUSION & FUTURE SCOPE

CONCLUSION

After reading this article, you must have got a clear


understanding of what Ansible is, what ansible is capable of,
and how can you improve the overall efficiency and
productivity in your project by implementing Ansible. If you
want to go deep into this topic, you can check the white paper
and sample playbooks available at the official Red Hat Ansible
website.

FUTURE SCOPE

The faster you try something new, even if you fail, the
faster you can move onto the next thing and try that. It’s all
about open experimentation, constant communication, and
a tolerance for failure.

24
REFERENCES

1.GOOGLE
- https://www.ansible.com/
2.INSTAGRAM
-@redhatinc

- https://www.ansible.com/use-cases

25

You might also like