Why to install and configure Ansible in Linux.
Using configuration management systems we can control large numbers of servers which makes system administrators life easy. In a nutshell we can control or manage huge number of server or systems from single central server with the help of automation tools.
There are many such tools are available for automation such as Chef or Puppet. However these tools are some what complex in nature. We have got great alternative to these options which is Ansible. Since its very much easy to install and configure Ansible in Linux.
How Ansible Works!
Ansible does not use any agents for carrying out the automation tasks, which means that there are no background processes runs on the clients. Instead Ansible makes connection using SSH for carrying out its operations.
Setup details for Ansible installation.
Ansible management server details:
OS: Red Hat Enterprise Linux Server release 7.2 (Maipo) Hostname: ansimgmt IP: 172.31.15.60 User: lradmin
Client machine details:
client 1 Hostname: web1 IP: 172.31.7.221 Client 2 Hostname: web2 IP: 172.31.25.35
Step1: Installing Ansible on management server.
For Linux Mint,Ubuntu and Debian
#apt-add-repository ppa:ansible/ansible #apt-get update && sudo apt-get install ansible
For RHEL,CentOS and Fedora
#yum install ansible
Please note that there are no official Ansible repository for RedHat , howerver we can still install Ansible by enabling epel repository under RHEL or Centos.
After installing the Ansible you can check the version using below command.
[root@ansimgmt ~]# ansible --version ansible 22.214.171.124 config file = /etc/ansible/ansible.cfg configured module search path = Default w/o overrides python version = 2.7.5 (default, Oct 11 2015, 17:47:16) [GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] [root@ansimgmt ~]#