Objective

The following guide describes simple to follow steps on how to install the latest version of the open-source automation engine Ansible.

Operating System and Software Versions

  • Operating System: - Debian Stretch 9

Requirements

Privileged access to you Debian Linux system will be required.

Difficulty

EASY

Conventions

  • # - requires given command to be executed with root privileges either directly as a root user or by use of sudo command
  • $ - given command to be executed as a regular non-privileged user

Instructions

Prerequisites

To start with, we need to install required prerequisites. Execute the following command to perform the installation of all prerequisites:
# apt update
# apt install make git make python-setuptools gcc python-dev libffi-dev libssl-dev

Download Ansible source code

Download Ansible source code using git command:
$ git clone git://github.com/ansible/ansible.git
Nevigate to ansible directory:
$ cd ansible

Select Ansible Version

This step is optional as it only allows you to select a desired Ansible version to be installed on your system. The following command will list all available Ansible stable versions:
$  git branch -a | grep stable
  remotes/origin/stable-1.9
  remotes/origin/stable-2.0
  remotes/origin/stable-2.0-network
  remotes/origin/stable-2.0.0.1
  remotes/origin/stable-2.1
  remotes/origin/stable-2.2
  remotes/origin/stable-2.3
Take a note of you desired version and execute git checkout. For example to set Ansible version stable-2.2 run:
$ git checkout stable-2.2

Ansible Installation

All what has left is to perform compilation and Ansible installation:
$ make
# make install

Confirm Ansible Installation

Test the Ansible installation by quiring its version:
$ ansible --version
ansible 2.2.2.0
  config file = 
  configured module search path = Default w/o overrides