Automation with Ansible

We all hate repetitive work right? Yes ofcourse we hate things and tasks that come and go round and round. That was a stupid question to ask 😊. Then also I asked because I know a tool which love repetitive work, Ansible 😍.

There are several scenarios in a Devops environment where people do repetitive tasks which can be automated. Like adding a new feature and rolling out the updated version of there product. This task may involve copying the new application to servers and restarting the servers one by one. This is a very common task which ops do and can be automated. When tasks get automated the entire process from development to deployment get accelerated. That acceleration can decrease the time required to roll out new updated version of the app from months to weeks or weeks to days or days to hours. Sounds cool 😎.

For doing automation there are many tools available like puppet, chef, saltstack and ansible. The key difference between ansible and all other automation tools is  ansible is agent less. Agent less in the sense we don't need to install a client software on every nodes in a network. Ansible can communicate and configure any nodes in a network using the default ssh. Now you might be thinking it can't be used for configuring windows machine. But yes it's possible in ansible by using a different connection module called winrm. The only requirement is powershell must be installed on windows machines.

In other automation tools like chef or puppet we need to install some client software to make a communication with the master node which we use to automate tasks.

Some common terminologies in ansible:

Playbooks : Set of plays
Play : Set of tasks
tasks : Tasks are like installing a package or restarting a service
roles: Roles are organized structure of playbook which are ready to share with  others 
modules : Modules are kind of functions for doing a particular task. For eg. to install a package we can do it with command module. But instead of using command module you can use yum or apt module depending on your linux flavour.
ansible-galaxy : Online repository of roles where we can share or download and install roles
ansible-vault : Addon tool for encrypting valuable informations like password
ansible-playbook : Tool which is used to run playbook
ansible-doc : Tool which can be used to search and read documentation of available modules eg: ansible-doc command

Ansible architecture

source: Internet

Installation of ansible

$ sudo apt-get install software-properties-common
$ sudo apt-add-repository ppa:ansible/ansible
$ sudo apt-get update
$ sudo apt-get install ansible 
Simple example:

ansible localhost -m command -a whoami

After installation when you try the above statement on your terminal you can see it successfully show you the hostname. Here what ansible is doing it is making a local connection instead of ssh connection because the hostname which we are specified here is localhost. -m is for specifying the module to be used and we are using command module here. -a is for passing the arguments if any.

Hope you enjoyed reading about ansible. So lets start cooking something with ansible. Ansible + AWS?? Stay tuned 😎
- Thanks


  1. Good,a nice and simple introduction

  2. Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.

    rpa Training in Bangalore

  3. think for a class found this site and did not regret it I was really lucky to find it effective online casino reviews Want to try gambling then only here

  4. Wow its a very good post. The information provided by you is really very good and helpful for me. Keep sharing good information.

    Best Training Institute in Bangalore BTM. My Class Training Bangalore training center for certified course, learning on Software Training Course by expert faculties, also provides job placement for fresher, experience job seekers.
    Software Training Institute in Bangalore

  5. Thank you so much for the great and very beneficial stuff that you have shared with the world.

    Learn Hadoop Training from the Industry Experts we bridge the gap between the need of the industry. Softgen Infotech provide the Best Hadoop Training in Bangalore with 100% Placement Assistance. Book a Free Demo Today.
    Big Data Analytics Training in Bangalore
    Tableau Training in Bangalore
    Data Science Training in Bangalore
    Workday Training in Bangalore

  6. Thanks for a marvelous posting! I seriously enjoyed reading it, you are
    a great author.I will be sure to bookmark your blog and will often come back in the future.
    I want to encourage yourself to continue your great job, have a
    nice weekend!

    data science training in chennai

    data science training in velachery

    android training in chennai

    android training in velachery

    devops training in chennai

    devops training in velachery

    artificial intelligence training in chennai

    artificial intelligence training in velachery

  7. I realize that, the skills that the companies wants now are different from the skills that I have learnt during my degree course, for the reason that all the companies are digital orientated. data science course syllabus

  8. This was a very informative article, indeed loved to read and clear my doubts. Keep us posted a lot more blogs. Also check out our blog pages too.

    data science training in chennai

    ccna training in chennai

    iot training in chennai

    cyber security training in chennai

    ethical hacking training in chennai


Post a Comment

Popular Posts