What is Ansible? and its features

Ansible

Ansible is a very powerful open source automation tool. It comes in the category of Configuration Management tools like Puppet, Chef, Saltstack etc. Its simplest among all the configuration management tool in terms of its easy to read & write approach and Masterless/serverless architecture. Being simple in use it can handle most complex of the task when it comes to Orchestration, where you run automation tasks in chain and order on several different servers and devices

Configuration Management

In simple terms, tools that manages configuration of IT infrastructures like OS, network devices, Application, softwares and Cloud computing services are called as Configuration Management tools. Configuration of IT Infrastructure like Softwares & OS changes happens every now and then. We add, remove and update them for good. Doing such changes to hundreds of servers and devices is very time consuming and error prone task if you do it manually. These tools help you manage and automate all that changes with ease and from a centralised place.

Features:

Centralized configuration

Configuration of various servers and devices are managed from a central server. Like you would be managing webservers, dbservers or switches all of their configurations like software, patches, config files etc can be setup in the central server. When the node wants to update the latest changes, it can fetch from the server or pushed to the node from server.

Enforcement

Configuration enforcement may be the single most important feature of a configuration management tool. By running regularly and ensuring the machine is configured to the desired state, configuration management tools prevent configuration to go out of sync. Configuration drift can happen in a variety of ways: Package updates, live debugging, "helpful" co-workers, etc. Whatever the cause, being able to say with confidence, "This is how this machine is configured," is a great way to shorten incident resolution time and reduce surprises.

Abstraction

Few sysadmins maintain completely homogeneous environments. Even if you're an all-Linux shop, you probably have multiple distros that you support, or at least multiple versions of a distro. With configuration management tools, many of the operating-system-specific implementations of a configuration are abstracted away for you. The same configuration file can be used to manage, for example, the installation of Apache HTTPD on both Red Hat and Ubuntu systems.

Version control friendly

Of course, the best way to enable cooperation is to have everything in a version control system. All of the tools listed below use some form of text for configuration. This means you can take advantage of the benefits of your favourite version control system.

Replication

Configuration management makes it easy to replicate environments with the exact same software and configurations. This enables you to effectively build a multistage ecosystem, with production, development, and testing servers.

Some Configuration Management Tools

1. Puppet
2. Chef
3. Ansible
4. Saltstack
5. CFEngine

Some Terminologies

Change Management

It is process when any specific configuration of the machine or software is changed. A typical CM process in IT industry goes through a approval process from customer or higher management, of course we are talking about production systems. A single change on 1, 10 or 100’s of servers has to be done very precisely and effectively. For example, upgrading a software package which has a bug on hundreds of servers or restarting a service like webservice to take effect of any new changes.

Provisioning

In general, provisioning means "providing" or making something available in the IT infrastructure. For example, provisioning a web server means installing and setting up web service softwares and its configuration on a OS. Provisioning a cloud instance means creating a virtual machine on the cloud. 


Orchestration

Automation is when we group list of tasks and execute them in top to down order through a script generally like installing webserver through a script. Whereas Orchestration is the process where we group multiple automated tasks and execute them into an order. For example, if we are orchestrating setup of a multi-tier web application, we have to setup all the services like Databases, Webservices, Loadbalancer, monitoring in an order so it gets validate when we have entire setup running. First, we will setup Database service so when webservice is setup it gets connected to database and gets validated. Next, we may setup Loadbalancer and add webservices under it. Monitoring would be setup at the very end. Now monitoring services will return right results from loadbalancer, web service and database service. This process is called as Orchestration but not limited to just this and is done for variety of other IT infrastructure process like cloud computing, network setup etc. 

Orchestration word has come from the word Orchestra where different instruments are played in a proper order to generate the beautiful Melody. It’s all about order otherwise you don’t get music all you get is sound and probably not so good.
Similarly, IT orchestration is all about automating tasks in a proper order.


Idempotent Behaviour

Configuration management tools keep track of the state of resources in order to avoid repeating tasks that were executed before. If a package was already installed, the tool won't try to install it again. The objective is that after each provisioning run the system reaches (or keeps) the desired state, even if you run it multiple times. This is what characterizes these tools as having an idempotent behaviour. One more example would be if we are trying to push a file to multiple servers and some servers already have the same file with the same content then it’s not going to overwrite the file, will simply skip it and push it to their servers where there is a mismatch.

Ansible Introduction

Ansible can control large number of servers and eases administration and operations tasks. Ansible can do simple configuration management and complex orchestration, it has all the features that config tools have plus it’s very easy to learn and implement. It communicates over normal SSH channels in order to retrieve information from remote machines, issue commands, and copy files. For windows node it uses winrm. 

Since it uses SSH for Linux and winrm for windows there no need to setup anything at the agent side as ssh comes by default in Linux servers and so as winrm in windows server.

For more information about Visualpath, visit www.visualpath.in and follow the company on Facebook and Twitter.

Comments