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
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
Next install python3-pip application.
sudo apt install python3-pip
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
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
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
This is time to test ansible working, I tested pinging localhost and all look good with getting response ping: pong.
ansible localhost -m ping
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