Ansible is an open source, powerful automation software for configuring, managing and deploying software applications on the nodes without any downtime just by using SSH. Today, most of the IT Automation tools runs as a agent in remote host, but ansible just need a SSH connection and Python (2.4 or later) to be installed on the remote nodes to perform it’s action.
Installation of Ansible
Prerequisites
Operating System: RHEL/CentOS/Fedora and Ubuntu/Debian/Linux Mint
Jinja2: A modern, fast and easy to use stand-alone template engine for Python.
PyYAML: A YAML parser and emitter for the Python programming language.
parmiko: A native Python SSHv2 channel library.
httplib2: A comprehensive HTTP client library.
sshpass: A non-interactive ssh password authentication.
Python:
Python installation
[root@master ~]# yum install python
Loaded plugins: product-id, refresh-packagekit, subscription-manager
Updating Red Hat repositories.
Setting up Install Process
Package python-2.6.6-20.el6.i686 already installed and latest version
Nothing to do
[root@master ~]#
[root@master ~]# python -V
Python 2.6.6
[root@master ~]#
epel requirements
RHEL6
## RHEL/CentOS 6 32-Bit ##
# wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm
## RHEL/CentOS 6 64-Bit ##
# wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm
In case yum doesn't work,
sed -i 's/https/http/g' /etc/yum.repos.d/epel.repo
RHEL7
## RHEL/CentOS 7 64-Bit ##
# wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm
# rpm -ivh epel-release-7-8.noarch.rpm
Other dependcies
yum install python-dev python-pip *httplib2* python-devel *libevent-devel* libffi-dev* g++* libssl-dev*
Openssl should following version openssl-1.0.1e
Ansible installation with pip
[root@master ~]# pip install ansible
You are using pip version 7.1.0, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting ansible
/usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Using cached ansible-2.1.1.0.tar.gz
Collecting paramiko (from ansible)
Using cached paramiko-2.0.2-py2.py3-none-any.whl
Collecting jinja2 (from ansible)
Using cached Jinja2-2.8-py2.py3-none-any.whl
Collecting PyYAML (from ansible)
Using cached PyYAML-3.12.tar.gz
Requirement already satisfied (use --upgrade to upgrade): setuptools in /usr/lib/python2.6/site-packages (from ansible)
Collecting pycrypto>=2.6 (from ansible)
Using cached pycrypto-2.6.1.tar.gz
Requirement already satisfied (use --upgrade to upgrade): pyasn1>=0.1.7 in /usr/lib/python2.6/site-packages (from paramiko->ansible)
Collecting cryptography>=1.1 (from paramiko->ansible)
Using cached cryptography-1.5.tar.gz
Requirement already satisfied (use --upgrade to upgrade): MarkupSafe in /usr/lib/python2.6/site-packages (from jinja2->ansible)
Requirement already satisfied (use --upgrade to upgrade): idna>=2.0 in /usr/lib/python2.6/site-packages (from cryptography>=1.1->paramiko->ansible)
Requirement already satisfied (use --upgrade to upgrade): six>=1.4.1 in /usr/lib/python2.6/site-packages (from cryptography>=1.1->paramiko->ansible)
Requirement already satisfied (use --upgrade to upgrade): enum34 in /usr/lib/python2.6/site-packages (from cryptography>=1.1->paramiko->ansible)
Requirement already satisfied (use --upgrade to upgrade): ipaddress in /usr/lib/python2.6/site-packages (from cryptography>=1.1->paramiko->ansible)
Requirement already satisfied (use --upgrade to upgrade): cffi>=1.4.1 in /usr/lib/python2.6/site-packages (from cryptography>=1.1->paramiko->ansible)
Requirement already satisfied (use --upgrade to upgrade): pycparser in /usr/lib/python2.6/site-packages (from cffi>=1.4.1->cryptography>=1.1->paramiko->ansible)
Installing collected packages: cryptography, paramiko, jinja2, PyYAML, pycrypto, ansible
Running setup.py install for cryptography
Running setup.py install for PyYAML
Running setup.py install for pycrypto
Running setup.py install for ansible
Successfully installed PyYAML-3.12 ansible-2.1.1.0 cryptography-1.5 jinja2-2.8 paramiko-2.0.2 pycrypto-2.6.1
[root@master ~]#
No comments:
Post a Comment