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
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.
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.
[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