HomeGuidesAPI Reference
GuidesAPI ReferenceGitHubAirheads Developer CommunityLog In
Guides

Installing Ansible

Instructions for installing Ansible

❗️

Refer to Ansible Installation Guide

Please refer to the Ansible Installation Guide for up-to-date information regarding installation, or if you have trouble installing Ansible.

Prerequisites

Main point of requirement is a "Control Node" which is essentially a Linux machine. Some Linux distributions come with Python2 and/or Python3 pre-installed. Ansible requires Python2.7 or Python3.5 or later.

Check the Python version on the desired control machine and verify the output:

administrator@Ansible-Ubuntu:~$ python --version
Python 2.7.17
administrator@Ansible-Ubuntu:~$ python3 --version
Python 3.6.9

If Python is not installed, install Python through the package installer of your Linux distribution. The following commands apply to Ubuntu 16.04 or later:

  • Python2.7:
    sudo apt install python2.7
  • Python3.5 or later:
    sudo apt install python3.5
    sudo apt install python3.6
    sudo apt install python3.7

Installing Ansible on Ubuntu 18.04:

📘

Ansible is only compatible with Unix-like operating systems, such as Linux or macOS. Windows is not supported. For instructions on how to install Ansible on other operating systems, please see the Ansible Installation Guide linked above.

Ansible can be installed through one of two methods:

  1. Through apt-get (or another package installer if you're using another operating system) :
  • First, you’ll need to add the repository to your package installer:
    sudo apt-add-repository --yes --update ppa:ansible/ansible
  • Then, you can install Ansible:
    sudo apt-get install ansible
  1. Through Git:
  • Clone the latest developer version of Ansible with "git clone":
    git clone https://github.com/ansible/ansible.git --recursive
  • Navigate into the cloned folder and set up your environment by running the script in the "hacking" directory:
    cd ansible
    source ./hacking/env-setup

What’s Next