Install & Configure Ansible in RHEL 8 (CentOS 8) | Ansible Configuration in Linux | Nehra Classes

preview_player
Показать описание
Install & Configure Ansible in RHEL 8 (CentOS 8):
=================================================
Ansible is an open-source software provisioning, configuration management and application-deployment tool enabling infrastructure as code. It runs on many Unix-like systems, and can configure both Unix-like systems as well as Microsoft Windows.
It includes its own declarative language to describe system configuration.
Ansible was written by Michael DeHaan and acquired by Red Hat in 2015. Ansible is agentless, temporarily connecting remotely via SSH or Windows Remote Management (allowing remote PowerShell execution)
to do its tasks.

On RHEL 8, enable the official Red Hat repository, for the corresponding Ansible version that you want to install as shown in this article. DO NOT USE PIP ON RHEL 8!.

Step 1: Installing Python3
Usually, RHEL 8 and CentOS 8 will come with Python3 already installed by default. However, If for whatever reason Python3 is not installed, install it using the following dnf commands. Make sure you must log in as normal user with Sudo privileges.
# visudo
vikasnehra
# su - vikasnehra
$ sudo dnf update
$ sudo dnf install python3

To verify that indeed you have python3 installed, run the command.
$ python3 -V

Step 2: Installing PIP – The Python Package Installer
Pip is a Python’s package manager, which is also comes preinstalled, but again, in case Pip is missing on your system, install it using the command.
$ sudo dnf install python3-pip

Step 3: Installing the Ansible Automation Tool
With all the prerequisites met, install ansible by running the command on CentOS 8.
# pip3 install ansible --user

On RHEL 8, enable the Ansible Engine repository to install corresponding Ansible version as shown,
# subscription-manager repos --enable ansible-2.8-for-rhel-8-x86_64-rpms
# dnf -y install ansible

To check the version of Ansible, run.
# ansible --version

Step 4: Testing the Ansible Automation Tool
To test ansible, first ensure that ssh is up and running.
$ sudo systemctl status sshd

Next, we need to create the hosts file in the /etc/ansible directory to define host machines.
$ sudo mkdir /etc/ansible
$ cd /etc/ansible
$ sudo vim hosts

The hosts the file will be the inventory where you will have all your remote nodes.

Now open hosts file with your favorite editor and define the remote node as shown.
[web]
192.168.1.109

Next, generate SSH keys from which we will copy the public key to the remote node.
$ ssh-keygen

To copy the generated SSH key to the remote node run the command.

Now use Ansible to ping the remote node as shown.
$ ansible -i /etc/ansible/hosts web -m ping

We have managed to successfully install and test Ansible on RHEL/CentOS 8 Linux distribution. If you have any questions, do share with us in the comments section below.
===
Thanks for watching the video. If it helped you then, please do like & share it with others as well. Feel free to post your queries & suggestions, we will be glad to answer your queries.
If you like our hard work then do subscribe to our channel & turn on the bell notification for latest updates.
===
Contact Us:
===
©COPYRIGHT. ALL RIGHTS RESERVED.

#NehraClasses #LinuxTraining #Trending
Рекомендации по теме
Комментарии
Автор

thank you for your clear cut explanation for my issue

NagaRaju-jqho
Автор

After the python version 2.6 we no need to install python at control node python support automatically of Ansible

SanjayVerma-srmg
Автор

thankyou very much sir this video helped me al lot

tazaccking
Автор

command "python setup.py egg_info" failed with error code 1 in getting this error

aliadeel
Автор

Thanks sir, it's help to install and configure ansible

atulrai
Автор

ansible -i /etc/ansible/hosts web -m ping

[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
[WARNING]: Could not match supplied host pattern, ignoring: web

help please

diudhaka
Автор

sir when i am deploying a host engine in ovirt node, a error is showing: please help sir

failed to execute stage 'closing up': failed executing ansible-playbook

diudhaka
Автор

Thanks for the great explanation, can you also explain how to install Opensource AWX on top of it

gotoabid
Автор

Now open hosts file with your favorite editor and define the remote node as shown.
[web]
192.168.1.109 ----> in this u has written web what exactly have to give?? remote node name right how we can know that??

rohitnaidu
Автор

Sie how to enable copy and paste in rhel 8, im trying to copy from my laptop to rhel 8, it's not working plsss reply sir

saikrishnaroxx
Автор

hello sir, i try to install ansible and i had this problem: "This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register". can you help please.

mouyanslimane
Автор

Sir rhcsa and rhel dono mai kya difference hai dono ka purpose kya hai ye plz thoda bataye.

ankittyagi
Автор

Sir if u hv different user name at controlnode and manage host this will also work it's depend on ur choice

SanjayVerma-srmg
Автор

Pip3 command excute karne ke baad error aa raha hai

linuxtech
Автор

Contos me try kiya tha vi file open nhi ho rhi usme

its_
Автор

Make a video ssh server and client configuration with full explanation

reddysrkhar
Автор

I need support and rim ready to pay for the time.

adilhussain
Автор

Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last metadata expiration check: 0:18:09 ago on Mon 29 Aug 2022 07:29:35 AM UTC.
No match for argument: pyhton3-pip
Error: Unable to find a match: pyhton3-pip
got this

ItsmeRajivS