Introduction to Ansible (Configuration Management Tool)

Share via:

Introduction to Ansible (Configuration Management Tool)

Dear Readers,

In this article,we will see Introduction to Ansible.

Configuration Management
It is a method through which we automate admin tasks.
Configuration management tool turns your code into infrastructure.
So your code would be testable, repeatable and versionable.
Infrastructure refers to the composite of —

    1. Software
    2. Network
    3. People
    4. Process

Pain Points

  • Management user and group accounts.
  • Dealing with packages.
  • Taking backup.
  • Deploying  all kinds of applications.
  • Configure services.

Why configuration management tool?

  • Complete Automation.
  • Increase up time.
  • Improve performance.
  • Ensure compliance (Machines follow strict procedures).
  • Prevent errors (Machine won’t do any mistakes).
  • Reduces cost.

What is Ansible?

  • Ansible is one among the DevOps configuration management tools which is renowned for its simplicity.
  • It is an open source software developed by Michael DeHaan and its ownership is on RedHat
  • Ansible is an open source IT Configuration Management, Deployment & Orchestration tool.
  • It aims to provide large productivity gains to a wide variety of automation challenges.
  • This tool is very simple to use yet powerful enough to automate complex multi-tier IT application                           environments.
  • Ansible is an automation tool that provides a way to define infrastructure as code.
  • Infrastructure as code (IAC) simply means that managing infrastructure by writing code rather than using             manual processes.
  • The best part is that you don’t even need to know the commands used to accomplish a particular task.
  • You just need to specify what state you want the system to be in and Ansible will take care of it.

Why Ansible?

  • Ansible is an administration tool.
  • Whatever system admins (windows/Linux) used to do manually.
  • Now , we are automating all those tasks by using chef (Any configuration management tool).
  • Can use this tool whether your servers are in on-premises or in the cloud.
  • It turns your code into infrastructure.
  • Your computing environment has some of the same attributes as your application.
  • Your code is versionable, repeatable and testable.
  • You only need to tell what the desired configuration should be, not how to achieve it.
  • Through automation ,get desired state of server.
  • Large companies have a continually changing infrastructure that requires be configuring and maintaining           time to time.
  • Other tools in the market can be really complicated.
  • huge overhead of Infrastructure setup.
  • It is a very complicated setup.
  • It is a pull mechanism.
  • Lot of learning required.

Ansible provides:

Continuous deployment
Software is deployed continuously enabling a company to keep in pace with the market requirements.
Increases system robustness
Infrastructure automation ensures all bugs are caught and removed before deploying the software.
Adapt to the cloud
The chef is easily integrated with infrastructure on the cloud.
Entire infrastructure can be recorded in the form of a repository that can be used as a blueprint to recreate the infrastructure from scratch.

How Ansible works?

Ansible works by connecting to your nodes and pushing out a small program called Ansible modules to them.Then Ansible executed these modules and removed them after finished.The library of modules can reside on any machine, and there are no daemons, servers, or databases required.The Management Node is the controlling node that controls the entire execution of the playbook.The inventory file provides the list of hosts where the Ansible modules need to be run.The Management Node makes an SSH connection and executes the small modules on the host’s machine and install the software.Ansible removes the modules once those are installed so expertly. It connects to the host machine executes the instructions, and if it is successfully installed, then remove that code in which one was copied on the host machine.

Ansible basically consists of three components
Ansible requires the following components in order to automate Network Infrastructure.

  1. Controlling Nodes
  2. Managed Nodes
  3. Ansible Playbook

Controlling Nodes
are usually Linux Bastion Servers that are used to access the switches/routers and other Network Devices.
These Network Devices are referred to as the Managed Nodes.
Managed Nodes
Managed Nodes are stored in the hosts file for Ansible automation.
Ansible Playbook
Ansible Playbooks are expressed in YAML format and serve as the repository for the various tasks that will be executed on the Managed Nodes (hosts).
Playbooks are a collection of tasks that will be run on one or more hosts.

Ansible Terminology

Controller Machine/Ansible Server
The machine where Ansible is installed, responsible for running the provisioning on the servers you are managing.
Inventory
An initialization file that contains information about the servers you are managing.
Playbook
The entry point for Ansible provisioning, where the automation is defined through tasks using YAML format.
Task
A block that defines a single procedure to be executed, e.g. Install a package.
Module
A module typically abstracts a system task, like dealing with packages or creating and changing files. Ansible has a multitude of built-in modules, but you can also create custom ones.
Modules
The module is a command or set of similar commands which is executed on the client-side.
Role
A pre-defined way for organizing playbooks and other files in order to facilitate sharing and reusing portions of a provisioning.
Play
A provisioning executed from start to finish is called a play. In simple words, execution of a playbook is called a play.
Facts
Global variables containing information about the system, like network interfaces or operating system.
Handlers
Used to trigger service status changes, like restarting or stopping a service.
Notifier
The section attributed to a task which calls a handler if the output is changed.
Tag
It is a name set to a task that can be used later on to issue just that specific task or group of jobs.

Advantages of Ansible

  • Ansible is an open-source tool.
  • No special coding skills are required to use Ansible’s playbooks.
  • Ansible allows you to model even highly complex IT workflows.
  • You can orchestrate the entire application environment no matter where it is deployed.
  • You can also customize it based on your needs.
  • You do not need to install any other software or firewall ports on the client systems you want to automate.
  • You do not need to set up a separate management structure.
  • Because you don’t have to install any extra software, there is more room for application resources on your         server.
  • Ansible is designed to be very simple, reliable, and consistent for configuration management.
  • Agentless
         Its work structure makes use of agentless architecture. The nodes are not required to install and run                     background daemons to connect  with a controlling machine.
  • Low overhead
         Low overhead due to agentless model, Ansibles reduces the overheads on the network by preventing the         nodes from polling the controlling machine.
  • Secure and consistent
         Ansible only uses SSH and Python on the managed nodes. This ensures safety and security. Also, Ansible           ensures consistent environments.
  • Reliable
         Ansible playbook can be idempotent when written carefully. This prevents unexpected side-effects on the         managed systems.
  • Good performance
         Ansible delivers flawless performance. Though it is very easy to set up yet it is a powerful tool for deploying       software applications using SSH.

Features of Ansible

Agentless – Which means there is no kind of software or any agent managing the node like other solution such as puppet and chef.

Python – Built on top of python, which is fast and one of the robust programming languages in today’s world.

SSH – Very simple passwordless network authentication protocol which is secure. So, your responsibility is to copy this key to the client.

Push architecture –  Push the necessary configurations to them, clients. All you have to do is, write down those configurations (playbook) and push them all at once to the nodes. You see how powerful it can be to push the changes to thousands of servers in minutes.

Setup –  a minimal requirement and configuration needed to get it to work.

Thank you for giving your valuable time to read the above information.
Follow us on 
Website  www.ktexperts.com
Facebook Page KTexperts
Linkedin Page : KT EXPERTS

Share via:
Note: Please test scripts in Non Prod before trying in Production.
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

Add Comment