How to install Ansible on Ubuntu

Ansible is one of the most popular and well supported automation frameworks to date. It allows you to manage your servers and applications configuration with sets of tasks, arranged in so called playbooks, by simply defining the desired end state. Ansible playbooks are basically YAML files in which the user defines those tasks, the states and commands to be executed. An Ansible playbook is typically executed on multiple targets, from a single point by using just an SSH connection.

To start using Ansible you’ll need to install only on a single server that you’ll be using for the execution of playbooks. In this article we’ll go through the steps to install the latest version of Ansible on an Ubuntu server.

Installation

To install the latest version you will need to add an custom PPA repository.

sudo apt-get update 
sudo apt-get install software-properties-common 
sudo apt-add-repository ppa:ansible/ansible

Then you can simply run the apt update:

sudo apt-get update 
sudo apt-get install ansible

Once the installation is complete, you can start using the set of Ansible application:

ansible             ansible-connection  ansible-doc         ansible-inventory   ansible-pull        ansible-vault
ansible-config      ansible-console     ansible-galaxy      ansible-playbook    ansible-test