Why use Ansible?

Tool for Configuration Managment

Why use Ansible?

Ansible is a DevOps tool that will be covered in this article. Check out my earlier blogs if you haven't already.

What is Ansible?

It is a tool that helps you to automate IT tasks. What do you mean by automating? It means "to make something operate by machine, without needing people".

You might be unaware of the details of how automation is applied to IT jobs. Let's first solve that. Numerous tasks need to be completed, including updates, weekly system restarts, backups, the creation of users, the assignment of groups, permissions, and many more. You could be thinking, "Yes, I used to see my PC doing these things without my involvement." amazing, isn't it? These tasks are carried out automatically without any human involvement.

Ansible significantly speeds up and streamlines all of these procedures. Ansible lets you run commands on your own computer. It configures, installs, and deploys using a YAML file. YAML is a language used to describe data ( If you want to know more about YAML check this). These files are adaptable to many environments. There will be fewer errors because it is automated. In ansible, local machines connect to the nodes through an SSH Client.

123.png

Modules

Small programs called modules carry out the real job in ansible. The module does one small specific task.

1_05pVPqG0aD3ED838Led3TA.png

Playbook

We now understand that modules perform a single, focused action; nevertheless, installing a complicated program requires grouping a number of modules in a precise order. Ansible Playbooks enter the picture to make that happen.

Tasks are collections of modules that are in order. Each task ensures that each module is performed with a certain set of inputs and also provides the task's name and description. In addition to defining the order in which the activities should be completed, we also need to specify where and by whom each job should be carried out. We refer to this whole as Play.

A playbook is what we term a single YAML file that contains several plays. Playbook explains how and in what sequence modules are retained, as well as when and where duties are completed and the sequential order of plays. The core of ansible is the playbook.

image.png

ansible.jpg

Inventory

We have defined hosts in play. But haven't you thought about where these host values come from? Yes, this reference is defined in the ansible inventory. Inventory means all the machines involved in task executions.

156.webp

Read my earlier blog post about computer networking if you want to learn more about hosts, clients, and servers.

Why only Ansible?

One could wonder, "Why only Ansible? Why not other tools?" What makes Ansible unique? There are mainly two unique features in ansible one is

  1. Ansible is agentless. What do you mean by agentless, I hear your question. Normally, you have to physically visit that system to install an agent. However, with ansible, you only need to install it on one system, which is your local machine, thus you don't need to do anything else on the target servers. All of them may be remotely managed by this device.

  2. Ansible uses YAML. It's easy, simple, and clean.

Check this out if you're interested in learning about terraform.

That's all for now. Please like and share if you found this information informative. If you have any questions, please leave them in the comments section and I will do my best to answer them.

Thank you for reading, and I'll see you next time.

Did you find this article valuable?

Support WeMakeDevs by becoming a sponsor. Any amount is appreciated!