Simple way to install Ansible on RHEL/centOS machine

Ansible is an agentless automation tool which is used to configure systems, deploy the
software and orchestrate tasks such as continuous deployments. The word agentless
implies that the ansible does not require any software to be installed on the remote
machine. You only need to install ansible on one machine. From that machine, we can
control the fleet of remote machines. Ansible communicates with Linux and Windows
machine through SSH and WinRM protocol respectively.

In this post, we will see how to install ansible in the RHEL/CentOS machine.

1. To get Ansible for RHEL/CentOS 7, first ensure that the RHEL/CentOS 7 EPEL 
repository is installed
    sudo yum install epel-release

2. Update the RHEL/CentOS using yum command. This will install the available fixes from
the repository
    sudo yum update

3. Install the Ansible engine from the RHEL/CentOS repository
    sudo yum install ansible

4. Check the Ansible version.
    ansible --version

5. Validate the ansible installation by using ping module.
    ansible localhost -m ping    
        Reponse: 
                    localhost | SUCCESS => {
                    "changed": false,
                    "ping": "pong"
                    }

Comments

Post a Comment