Installing Ansible
In this section, we'll show you how to install Ansible on a control node. On Linux, we can install Ansible in a couple of ways:
- Using the platform-specific package manager (for example,
apt
on Ubuntu/Debian andyum
on RHEL/CentOS) - Using
pip
, the Python package manager
The Ansible community recommends pip
for installing Ansible since it provides the most recent stable version of Ansible. In this section, we'll use both methods on Ubuntu and RHEL/CentOS. For a complete Ansible installation guide for all major OS platforms, please follow the online documentation at https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html.
On the control node, Ansible requires Python, so before installing Ansible, we need to make sure we have Python installed on our system.
Important note
Python 2 is no longer supported as of January 1, 2020. Please use Python 3 instead.
Let's start by installing Ansible on Ubuntu...