top of page

Part 1 – Install Ansible on Linux

This article outlines how to install Ansible on Linux. This assumes that you already have a Linux machine ready to install Ansible on and some additional Linux VMs for Ansible to manage.

1. Ansible Installation

These are the steps to get Ansible installed on an Linux system.

1.1 Install Ansible through Package Manager

Since we are using Ubuntu, we will be installing Ansible through the Apt package manager. First, we need to configure PPA on the Ubuntu machine:

sudo apt-get install software-properties-common

1.2 Add Ansible PPA Repository

sudo apt-add-repository ppa:ansible/ansible

1.3 Get Updates

sudo apt-get update

1.4 Install Ansible

sudo apt-get install ansible

2. Configure Ansible

These steps outline some basic configuration that needs to occur before you really begin using Ansible.

2.1 Configure Ansible Inventory

Ansible needs you to list out the servers that it will manage in its inventory file. The default inventory file is located at /etc/ansible/hosts.

In my scenario here, I have two webservers that I would like Ansible to manage. I have listed them under the webservers group and have provided them with aliases mapped to their respective IP addresses.

2.2 Try a command

Now that we have some servers set up in our inventory file, we can try to ping those servers using the following ansible ad-hoc command:

ansible all -m ping

You could also try the following to ping only the servers listed in the webservers group:

ansible webservers -m ping

Share this:

  1. Facebook

  2. LinkedIn

  3. Twitter

  4. Email

#Ansible #ansibleinstallation

5 views0 comments
bottom of page