Install and Configure Ansible on Ubuntu 20.04 guide

28 May 2021

blog details

Install and Configure Ansible on Ubuntu 20.04 guide

By: RSDigitech | Published At : 28 May 2021    


Steps to Install and Configure Ansible on Ubuntu 20.04

Ansible is well-known for Configuration Management and Application Deployment system. It allows controlling a large number of remote machines in an automated fashion from a self-centered location. However, we can save space and time while Ansible installation and configuration.

Before you install the Ansible control machine and nodes for SSH connection, refer to this blog to know how to establish communication between two servers using SSH.

How to install Ansible:

1. To install Ansible, update the machine.

To install Ansible, update the machine.

2. Add the PPA ansible repository to your local.Add the PPA ansible repository to your local.

Add the PPA ansible repository to your local.2

3. Later press ENTER to continue.

4. Now, you can install ansible by running the following command.

Now, you can install ansible by running the following command.

Now, you can install ansible by running the following command.2

5. Enter "Y" to continue the next step.

6. Verify the Ansible version.

Verify the Ansible version.

7. Now the Output will be displayed like this

Now the Output will be displayed like this

Inventory setup:

Setup an inventory file of remote hosts to enable Ansible to communicate with them. To enable access, use the following command in the ansible master.Inventory setup

When executing the above command, the output of the vi-editorwill open. Now, you can add or remove hosts from the inventory file. The sample inventory file looks like below. 

inventory file

Now, you can add the Web host group under this we can add our node private IPs.

[testservers]

172.31.34.103

You can list out your host nodes using the below commands.

You can list out your host nodes using the below commands.

The output of the inventory list.

The output of the inventory list.

Test your connection:By using the PING module, we can test our node connection on the control machine by using the following command.

~# ansible all -m ping

 we can test our node connection2

Summary: The above steps lead to the successful setup, installation, and configuration of Ansible on Ubuntu 20.04. Additionally, this blog detailed the steps required for inventory setup, testing connection methods, and commands.

Technologywe use

  • PHP
  • Angular
  • Android
  • Laravel
  • Salesforce
  • Tibco
  • Mulesoft