Menu

Virtual Geek

Tales from real IT system administrators world and non-production environment

Step by Step Install Ansible on Ubuntu OS

Although I had already written a few articles on How to install Ansible on Linux for vSphere configuration and Using Ansible for Managing VMware vsphere Infrastructure, this blog relates to different OS. I switched my lab Linux OS from CentOS to Ubuntu and Here are the step by step procedure to install Ansible on Ubuntu server. Before starting installation, make sure you update the OS with below command.

sudo apt-get update -y

Redhat ansible tower instalation sudo apt-get update -y archive Ubuntu focal-security inrelease.png

As every time I am using sudo it asks for root password, I am using sudo interactively and upgraded ubuntu os, and installed Ansible prerequisite bundle python-setuptools.

sudo -i
sudo apt-get upgrade -y
sudo apt-get install python-setuptools -y

Redhat Ansible tower awx Ubuntu sudo -i su - apt-get upgrade -y sudo apt-get install python-setuptools -y devops automation.png

Next install python3-pip application.

sudo apt install python3-pip

Ubuntu terminal apt-get install python3-pip apt pip dependency package python perl amd65 ansible redhat automation devops scripting yml yaml.png

In the last install Ansible package using pip3, as you can see it is installing all the related dependency packages jinja2 and ansible core version 2.11.4.

sudo pip3 install ansible

Ansible Redhat terminal pip3 install ansible ubuntu devops pyYaml cryptography python3 whl wheel dist-packages.png

As I am going to use ansible for VMware vSphere management purpose, I am installing related pyvmomi python modules with pip3 command.

sudo pip3 install pyvmomi

Ansible PIP3 install pyvmomi pip3 python yaml yml installation ubuntu wheel packages pip python3 apt-get vmware vsphere.png

I need one more ansible module collection from vmware community which I will download install using ansible-galaxy command as example below.

sudo ansible-galaxy collection install community.vmware

Ansible automation devops yml yaml ansible-galaxy collection install community.vmware vsphere vcenter esxi dpendancy map collections install on ubuntu apt-get.png

This is time to test ansible working, I tested pinging localhost and all look good with getting response ping: pong.

ansible localhost -m ping

Redhat ansible localhost module ping no inventory localhost ping pong devops certification automation success failure ubuntu install anisble pip python module wheel.png

Useful Articles
Getting started Ansible AWX tower for IT automation run first playbook
Ansible for VMwary Using vmware_vm_inventory dynamic inventory plugin
Ansible selectattr The error was TemplateRuntimeError no test named 'equalto'
ansible create an array with set_fact
Ansible get information from esxi advanced settings nested dictionary with unique keynames
Install Ansible AWX Tower on Ubuntu Linux
Ansible AWX installation error Cannot have both the docker-py and docker python modules
Ansible AWX installation error docker-compose run --rm --service-ports task awx-manage migrate --no-input
docker: Got permission denied while trying to connect to the Docker daemon socket
Ansible AWX Tower create Manual SCM (Source Control Credential Type) project
Reset Ansible AWX Tower admin password
Install Ansible AWX on Microsoft Windows OS

Go Back

Comment

Blog Search

Page Views

6346904

Follow me on Blogarama