How to install Ansible in Ubuntu

Ansible is an open-source automation engine that automates software provisioning, configuration management, and application deployment.

This article explains the steps to install Ansible in Ubuntu server.

Step1: Add repository files

#apt-add-repository -y ppa:ansible/ansible

Step2: Update the repositories

#apt-get update

Step3: Install ansible

#apt-get install -y ansible

Step4: Move the default hosts configuration

#mv /etc/ansible/hosts /etc/ansible/hosts.orig

Step5: Create new hosts configuration file and add the servers

#vi /etc/ansible/hosts

[servers]

192.168.22.10

192.168.22.11

[local]

127.0.0.1

Step6: Check the configuration by running commands

#ansible all -m ping -s -k

Note: all - Use all defined servers from the inventory file

-m ping - Use the "ping" module, which simply runs the ping command and returns the results

-s - Use "sudo" to run the commands

-k - Ask for a password rather than use key-based authentication

 

That's all......

Leave a Reply

Your email address will not be published. Required fields are marked *