Introduction To Configuration Management And Ansible

This is going to be a series of articles where we are going to learn Ansible from scratch, but before that lets' first understand the basics.
 
So, in this article, we will be covering the following things.
  • What is Configuration Management?
  • Benefits of using configuration management tools.
  • What are Ansible, connectivity, and its architecture?

What is Configuration Management?

 
Configuration Management can be considered as a process that manages the configuration of IT infrastructures, like operating systems, network devices, applications, cloud services, and software.
 
By enabling you to deliver better software faster, configuration management helps lay the foundation for DevOps. 
 
Configuration Management is important because it enables the ability to scale the infrastructure and software systems without having to correspondingly scale administrative staff to manage those systems.
 

Benefits of using configuration management tools

 
There are a lot of benefits of using configuration management tools and there are plenty of tools available in the market, each with their own set of features and capabilities, like Ansible, chef, puppet etc.
 
Some of the benefits of using Configuration Management Tools include -
  • Consistency of systems and software.
  • When it is combined with automation, then it can improve efficiency as the manual configuration is quite slow and error-prone.
  • We can run the configurations on multiple machines at the same time.
  • It has centralized configuration means the configuration of various servers and devices are being done from the centralized server.
  • Configuration management makes it easier to replicate environments with the exact same set of software and configurations.
  • They support Idempotent behavior, which means keeping track of the state of resources in order to avoid repetitive tasks that got executed earlier.

What are Ansible, connectivity, and its architecture?

 
One of the most popular configuration management tools in the market is Ansible.
 

Introduction to Ansible

 
Ansible is an IT automation tool. It can configure systems, deploy software, and orchestrate more advanced IT tasks such as continuous deployments or zero downtime rolling updates.
 
Its main goal is simplicity and allows you to do the stuff with ease.
 
Ansible doesn’t need any client to be installed on the target machines but Other tools like Chef or puppet need the target machine to have puppet client or chef client to be installed on the target machines.
 

Connectivity

 
Target machines/services are accessed by SSH, winrm, and API.
 
This is no residual software which means that when the execution gets completed, Ansible wipes out any residual software. Often, when we run the script on target machines manually, we don’t clean any files which got created due to the execution of our scripts but with Ansible, if some files got created (suppose in the temp directory), then Ansible will wipe out all those files automatically.
 

Architecture

 
Ansible is a radically simple IT automation engine that automates cloud provisioning, configuration management, application deployment, intra-service orchestration, and many other IT needs.
 
Ansible can perform simple configuration management tasks and complex orchestration. It comes with all the features that a configuration management tool should have and also is very easy to learn and implement.
 
It uses SSH for the communication over SSH channel to get information from the remote machines, to run commands on the remote machines and to copy files.
 
It uses SSH for Linux and winrm for windows and there is no need to set up additional software at the target machine and we know SSH comes by default in Linux servers and winrm by default in windows servers.
 
 
Ansible has a very simple architecture as they believe in simplicity. Its main components are Inventory, Playbook, and modules.
  • Inventory is a text file where we save the host information that we want to manage using Ansible. The default location of the inventory file is /etc/ansible/hosts.
  • A playbook is an organized unit of scripts that defines work for a server configuration managed by the automation tool Ansible. Playbooks are expressed in YAML format and each playbook can contain one or more plays which use modules.
  • Modules are something which actually does the stuff and they are what gets executed in each playbook task. There are lots of modules that Ansible gives you to perform different tasks.
  • Some settings of ansible can be written in the global ansible.cfg file but we can also write our own ansible.cfg which has higher precedence over the global file.
  • Ansible is purely written in Python and all things will execute on Python interpreter.

Summary

 
That was the brief introduction on the configuration management and its benefits along with the introduction to one of the most popular tool (Ansible).
 
So don’t pay the price later! Use configuration management tools if you want to prevent a fire rather than fighting it.
 
I hope you find this article helpful. Stay tuned for more … Cheers!!


Similar Articles