DevOps
Let’s learn ansible and pass RHCE EX294 Exam Part 01
I’m creating this ansible tutorial article series to focus to the RedHat certified engineer new exam EX294.
This exam is mainly focused on the ansible.
so I,m starting from very basics and continue until cover the all the details which need to pass the exam. so this is the first article of the series. so let’s start.
what is ansible?
Ansible is an automation tool.
just think like this.
you are a system engineer and you want to install Nginx in 20 ubuntu servers. so if you do it manually you have to do it like 1 or 2 hours.
But if you use a tool like an ansible you can do it like within 5 minis by just using one command. Just take the idea we will discuss this later with details.
Please check the below diagram.
The Ansible software is only needed to install in one server.
in the above image, you can see the Ansible controller node, which is the server we install ansible.
then that ansible controller node can access the other servers through SSH. no need to install any agent in other servers. it is a huge benefit of ansible.
according to our Nginx example, we are running ansible command in “ansible control node” and Nginx will be installed in all 3 “managed hosts”
ok, lets setup ansible.
Setup ansible on Centos 8
we are going to create one ansible Control Node and three managed hosts like in the above image.
to create an ansible control node we have to install epel-release first. please note no need to install this package in other servers.
Run this command to install epel-release on centos 8
1 |
yum install epel-release |
after that, install ansible using bellow command in ansible controller node.
1 |
yum install ansible |
now you can verify ansible installation using bellow command.
1 |
ansible --version |
if the installation is successful, you will get an output like this
ansible is based on python. so all the servers including ansible master and managed nodes must have python installed.
But you no need to worry about it. Python is installed by default in RHEL 8 servers.
you can verify the python version on the ansible master node by executing the below command.
1 |
ansible -m setup localhost | grep ansible_python_version |
ok cool. you have learned some basics. we will cover all about ansible inventory in the next tutorial.
-
DevOps55 years ago
Saltstack Tutorial for beginners [2023]
-
DevOps55 years ago
How to build a Docker cron job Container easily [2023]
-
Linux55 years ago
mail Command in Linux/Unix with 10+ Examples [2023]
-
DevOps55 years ago
Docker ADD vs COPY vs VOLUME – [2023]
-
DevOps55 years ago
How to setup Pritunl VPN on AWS to Access Servers
-
Linux55 years ago
Grep Command In Unix/Linux with 25+ Examples [2023]
-
Linux55 years ago
How To setup Django with Postgres, Nginx, and Gunicorn on Ubuntu 20.04
-
Linux55 years ago
Find command in Unix/Linux with 30+ Examples [2023]