ans-pg-2

<< Introduction >>                                                                                                                                                << Ansible Inventory >>


Install Ansible

Ansible to be installed only on the Control Nodes for which ansible codes will run. Other managed systems are agent less and no ansible packages to be installed on them.
The control nodes should be a Unix or Linux system. Though the Windows machines can be managed by Ansible, it is not supported as a control node. Ansible needs Python with version 2.6 or later (Python 2) in the control node to install ansible as a pre-requisite. Note: - Python 3 is still in technology validation and that should not be used for ansible in production environment.
Below the specification of the system used in this tutorial:
OS – CentOS 7
Python – Version 2.7.5
Ansible can be installed in the control node (CentOS 7) using yum command. Check if the python has already been installed in the system by below command. If not yet installed, still the ansible installation will take python as well as dependency package while installing it.

[root@anslabsrv1 ~]# yum list installed python
Installed Packages
python.x86_64    2.7.5-86.el7        @anaconda
[root@anslabsrv1 ~]#

This shows that the python packages are already installed in the system. Let’s install ansible in the system now.

[root@anslabsrv1 ~]# yum install ansible -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.piconets.webwerks.in
 * extras: mirrors.piconets.webwerks.in
 * updates: mirrors.piconets.webwerks.in
Resolving Dependencies
--> Running transaction check
---> Package ansible.noarch 0:2.4.2.0-2.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================
 Package     Arch     Version         Repository     Size
===================================================================
Installing:
 Ansible     noarch     2.4.2.0-2.el7 extras         7.6 M

Transaction Summary
===================================================================
Install  1 Package

Total download size: 7.6 M
Installed size: 38 M
Downloading packages:
ansible-2.4.2.0-2.el7.noarch.rpm                                                                                  | 7.6 MB  00:00:02
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : ansible-2.4.2.0-2.el7.noarch                    1/1
  Verifying  : ansible-2.4.2.0-2.el7.noarch                    1/1

Installed:
  ansible.noarch 0:2.4.2.0-2.el7

Complete!
[root@anslabsrv1 ~]#

Now we have installed ansible binaries in our control system. You may refer the ansible website https://www.ansible.com/resources/get-started to obtain more details on installation and update of ansible.

Communication with Managed systems:
Ansible control node has to communicate with managed systems over the network. By default, ansible uses “ssh” as the protocol but for other devices like Windows systems and network devices, it might use other protocols as well. In addition to this python2-winrm RPM package with version 0.2.2 or later to be installed in the control node, if we need to manage any Windows based systems.

In the same time, manages hosts do not require ansible installed in it. But they also should have python 2 (2.4 or later) to be installed for most of the ansible modules to work. The package libselinux-python to be installed in the managed systems, if they are running with SELinux enabled. Keep in mind that python is not required in the managed systems to run some of the modules of ansible. Refer Ansible documentation for Installation, Ansible for networking and Ansible for Windows to get more details on the installation of control nodes and managed systems.



<< Introduction >>                                                                                                                                                << Ansible Inventory >>

Comments

Popular posts from this blog

AIX Firefox Installation

AIX Commands

How to increase swap size on CentOS 8 / RHEL 8

How to configure NTP in RHEL8 or CentOS 8 by chronyd.

System Administration

How to find big files in Linux, Unix, AIX

How to manage Linux systems through web browser (cockpit for Linux): CentOS 7, CentOS 8, RHEL 7, RHEL 8, Fedora, Ubuntu and Debian systems.

Remote X11 forwarding for AIX in command line.

How to enable VNC server (get GUI remotely) in CentOS 7, RHEL 7, CentOS 8 and RHEL 8 servers.

How to change Time Zone in CentOS 8, RHEL 8 and Ubuntu systems