Ansible is easy to install, and many distributions have ready-made packages in third-party repositories that can be installed directly. Other simple installation methods include using PIP to install it, or get the latest version from GitHub. If you want to install with your package Manager, you will probably need to EPEL the repository on Rhel/centos Linux-based systems.
The following is an authoritative guide to ansible in Chinese, which describes all the ways to install Ansible:
Http://ansible-tran.readthedocs.io/en/latest/docs/intro_installation.html
This article describes the installation of Ansible with PIP, Ansible installed with Pip, which is the latest version.
Environment:
CentOS6.75
Python2.6.6
1, pre-installation preparation:
Install dependent packages
# yum-y Install zlib-devel# yum-y install OpenSSL openssl-devel# yum-y install libffi libffi-devel# yum-y install gcc gcc-c++ # yum-y Install python-devel Python-simplejson python-setuptools
These are the basic environments for installing ansible with PIP and must be installed
2. Install Pip
Installing PIP with python2.6
#tar-xf pip-8.0.2#cd pip-8.0.2#python setup.py Install
3. The Python module required to install the Ansible
#pip Install Paramiko Pyyaml Jinja2 httplib2 Six
This step is important, if these modules are not installed, then ansible may not be able to run even if installed. I during the installation process because of the omitted this step, resulting in ansible2.1 installed, the execution of ansible command has been an error.
4, Installation Ansbile
#pip Install Ansible
5. View version
[Email protected] pip-8.1.0]# ansible--version/usr/lib64/python2.6/site-packages/cryptography/__init__.py:26: Deprecationwarning:python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of cryptography would drop support for Python 2.6 deprecationwarningansible 2.1.0.0 config file = conf igured Module Search Path = Default w/o Overrides
This article from "Zengestudy" blog, declined reprint!
1, PIP installation ansible