Get Ansible

This is a short article for self reference for the installation of Ansible. Ansible can be installed from different sources. In this article I will choose Pip for the latest version. Check the official installation guide for more information.

Install Ansible on Ubuntu or Debian with Pip

To install Ansible on Ubuntu or Debian, use Pip for the latest and greatest version. You can install the required packages beginning with Apt. First make sure you have the latest Apt updates on your server or desktop:

apt-get update

Then install the necessary Apt packages:

apt-get install python-dev python-pip libssl-dev

Then install Ansible with Pip.

pip install setuptools wheel ansible

Test your installation

$ ansible --version

ansible 2.x
  config file =
  configured module search path = Default w/o overrides

Good to go!

Ubuntu known issues

Errors I encountered while installing Ansible with Pip and Apt.

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Install the python-dev package with Apt.

Failed building wheel errors

Install the wheel package with Pip.

Failed gcc errors

Install libssl-dev package with Apt.

Install Ansible on CentOS with Pip

To install Ansible on CentOS, use PIP for the latest version. First get the required packages from Yum:

yum install python-pip python-devel gcc-c++ libffi-devel openssl-devel

Then install Ansible with Pip:

pip install ansible

Test your installation:

$ ansible --version

ansible 2.x
  config file =
  configured module search path = Default w/o overrides

Good to go!

CentOS known issues

Errors I encountered while installing Ansible with Pip and Yum.

Command "python setup.py egg_info" failed with error code 1

Install the gcc-c++ package with Yum.

error: command 'gcc' failed with exit status 1

Install the python-devel, openssl-devel, gcc-c++ or libffi-devel package with Yum.

MacOS

brew install ansible

Test your installation:

$ ansible --version

ansible 2.x
  config file =
  configured module search path = Default w/o overrides

Good to go!

MacOS known issues

None so far.


Comments

comments powered by Disqus