How to Install and Configure Ansible on CentOS 7

Ansible is the simplest way to automate apps and IT infrastructure. Application Deployment + Configuration Management + Continuous Delivery + software provisioning. You can find more details about Ansible

Ansible Installation:

In this guide, you’ll install Ansible on a CentOS servers. Started with Ansible, it need to be install on at least one machine. You can find more details about Ansible installation on other OS steps on official website.

Installation:
1.1. Ansible can be run from any machine with Python 2 (versions 2.6 or 2.7) or Python 3 (versions 3.5 and higher) installed.
1.2. Install the Python dependencies

$sudo pip install paramiko PyYAML Jinja2 httplib2 six

1.3. To get Ansible for CentOS 7, first ensure that the CentOS 7 EPEL repository is installed

$sudo yum install epel-release

1.4. After the repository is installed, install Ansible with yum

$sudo yum install ansible

Configuring Ansible Host/Machine:

After completion of the installation we need to setup the inventory/host file, default inventory file will be /etc/ansible/hosts. You can optionally specify an inventory file (see Inventory) other than /etc/ansible/hosts.

/etc/ansible/hosts
[servers]
host1 ansible_ssh_host=192.168.0.1
host2 ansible_ssh_host=192.168.0.2
host3 ansible_ssh_host=192.168.0.3

Now let’s test things with a ping command:

$ ansible all -m ping --ask-pass

Reference:-
http://docs.ansible.com/ansible/latest/intro_installation.html
https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-ansible-on-centos-7

Avinash Pawar

DevOps Practitioner interested in learning new technologies and interested in sharing the knowledge with others.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle Plus

Avinash Pawar

DevOps Practitioner interested in learning new technologies and interested in sharing the knowledge with others.

Leave a Reply