Need Assistance?

In only two hours, with an average response time of 15 minutes, our expert will have your problem sorted out.

Server Trouble?

For a single, all-inclusive fee, we guarantee the continuous reliability, safety, and blazing speed of your servers.

How To Install and Configure Ansible on Ubuntu 22.04?

install and configure ansible on ubuntu 22

Ansible is a free and open-source automation tool used to configuration management, application deployment and task automation. We at Skynats do Ansible automations for various tasks under our Server Management plan.

To install Ansible on your server, run the following command on your control node:

sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository --yes --update ppa:ansible/ansible
sudo apt install ansible

Verify the installation by using the command

sudo ansible --version

After that, create a user to perform Ansible tasks on both the control and managed node and give the sudo permissions.

sudo adduser ansible

Configure password less authentication for the created user from control node to managed nodes. For that, generate an SSH key pair and copy it to the managed nodes using the following commands.

ssh-keygen
ssh-copy-id [email protected]

Then, add the managed nodes IP addresses to the Ansible inventory file located in the /etc/ansible directory.

vim /etc/ansible/hosts

Add managed nodes IP addresses, then save and quit the inventory file. To list the managed nodes added in above step, run the command

ansible all -i hosts --list-hosts

All managed nodes added will be listed as shown below

We have now completed the Ansible installation and configuration. Next, we can verify the configuration by using the ping command from the Ansible control node to ensure that the managed nodes are available.

ansible -m ping all

If the output displayed was success, which means that managed nodes are available and we can perform the tasks using Ansible automation tool.

Our Technical Team will be available to assist you with Ansible automation tool services that can make your job a lot easier. Get in touch with Skynats if you have any queries.

Liked!! Share the post.

Get Support right now!

Start server management with our 24x7 monitoring and active support team

Can't get what you are looking for?

Available 24x7 for emergency support.