Total Pageviews

Translate

November 13, 2017

Introduction to Ansible for Automation

by 4hathacker  |  in Python at  11:58 PM

Hi folks!

There are a lot of terms I came across while getting started with Ansible. Before introducing the Ansible perspective, I would like to share with you some scenarios where Ansible or any other tool will be helpful.

1. Change Management


If you are running a server with some application deployed, any kind of change at this 'state' will be risky. It may be a positive change if scheduled earlier. But if it will be an unscheduled/unexpected change, it certainly results in negative impacts. To ensure the 'state' of servers, software or applications in production environment, changes must need to be reviewed and assessed accordingly. The whole prospect is covered under a single term called Change Management. In Change Management, the major focus is on the reasons behind the changes. It helps in discovering ways to improve the delivery process.

2. Provisioning

It is an idea build on top of Change Management. Provisioning in laymen terms can be described as an act of supplying something or providing something. Provisioning can be referred to as a system's transition from one 'state' to another 'state' after supplying some resources. With respect to Ansible, provisioning includes installing, configuring and starting different software or applications on a system in a much cleaner way. e.g. Configuring and starting MySql server in Linux OS. Here, after installation, the system will act as Database Server which represents a change of 'state'.

3. Automation

Automation refers to the accomplishment of a task automatically without human intervention. This helps in repeatedly doing the same task taking much lesser time and human efforts. Ansible is an IT automation tool which can take orders using simple tasks written in files (playbooks) and then executing them, making decisions on its own intelligently. Most of the use cases that I would like to appreciate is automation of tasks on remote servers with the help of Ansible. e.g. Updating numerous Windows Servers or installing patches to overcome security breach.

4. Orchestration

Do you have ever seen the synchronization of an orchestra? So, smoothly they manage to reproduce the music from different components at once. Orchestration refers to a well defined workflow of cohesive tasks to be accomplished automatically in a particular fashion. Orchestration and Automation are relative yet different terms. Actually Orchestration is a broader concept as compared to Automation. We can say that orchestration is coordination between automation of systems while automation simply describes the executions of tasks automatically.
e.g. Task1 - install and configure mongodb servers.
Task2 - setting mongodb engine for dbpath in settings.py file of django app.
Task3 - setting load balancer and making firewall entries properly
Task4 - starting django app

We have discussed the functions of Ansible. But how to install Ansible? Its pretty easy if we have 'pip' already in our system. The following commands we can fire, for installing Ansible.

pip install ansible

Please refer this link for assistance in installing Ansible. To check whether Ansible is installed or not, fire this command,

ansible --version

And the output will look like,

ansible 2.4.0.0
  config file = None
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Oct 11 2015, 17:47:16) [GCC 4.8.3 20140911 (Red Hat 4.8.3-9)]
We will come to know about different commands and features of Ansible in the upcoming posts.

0 comments:

Like Our Facebook Page

Nitin Sharma's DEV Profile
Proudly Designed by 4hathacker.