How to install ansible in centos server

Ansible is an open-source automation engine that automates software provisioning, configuration management, and application deployment.

This article explains the steps to install Ansible in Centos Server.

Step1: Add repository files

#yum install epel-release

Step2: Install ansible

#yum install -y ansible

Step3: Move the default hosts configuration

#mv /etc/ansible/hosts /etc/ansible/hosts.orig

Step4: Create new hosts configuration file and add the servers

#vi /etc/ansible/hosts



Step5: Check the configuration by running commands

#ansible all -m ping -s -k

Note: all - Use all defined servers from the inventory file

-m ping - Use the "ping" module, which simply runs the ping command and returns the results

-s - Use "sudo" to run the commands

-k - Ask for a password rather than use key-based authentication

That's all......

Leave a Reply