What is Ansible for Infrastructure Management ?

Shubham Katara
Nov 8 · 4 min read

The truth is, it doesn’t matter if you are a veteran or a novice in Infrastructure Management, Information Technology or an application developer, you are lazy.

Not to mention you love drinking your coffee, scrolling on reddit or stack overflow while you can hide the fact that your application is compiling / rendering / initializing and what not.

Having said that, being lazy not always necessarily mean you are non productive. It is a trait that you can find solution to problems in an easier fashion.

Managing thousands of servers can be a challenge. It is hell exciting as you get to feel the thrill of being the guy working in a data center. Your senses can go off the charts and your eyes will sparkle.

But if you are anything like me, your excitement will gradually go down if you do the same things on all of those servers which you loved at one time.

Because let’s face it. You are a traveler and you get a free trip every month to a place to visit. This time, it is Niagara Falls. Your excitement will be on cloud 9. You would pack up your bags, put your favorite cloths and be at the airport way before the departure time of your flight.

But if for all the next months, the sponsors of your travel decides for you to go at the same place, which is Niagara Falls, you would definitely not be excited after a couple of visits, even though it is Niagara Falls.

Doing the same things again and again and again on the same infrastructure manually is tiring, boring and mundane. While you could have been productive at some other places, you are stuck on installing apache on 1000 RHEL8 systems, manually.

And not to mention if you are making changes to the systems manually, there can be a configuration drift or human errors as we can never be too perfect as in what we do.

Wouldn’t that be great if you had someone who could do all of these things for you, without tiring or complaining, in a controlled, secure and easy fashion where you could just literally just say that:

  1. “ I want a specific version of Apache Web Server is installed on all the systems.“
  2. “… and also the Apache service is started and also enabled for auto restart if the server had to be rebooted. “
  3. “… along with a firewall rule be placed to allow firewall on port 80 from a specific source ( QA team ) for example. “
  4. “… and anew virtual hosting configuration should be in place and the service should restart if the configuration file was having the right syntax. “
  5. “ I would also like some test content, index.html for example to be deployed at /var/www/html “.
  6. “… and at the end, a test for web page accessibility should be done which gives should give me a constant feedback if the site was unreachable or the configuration was wrong. “

Now, these are just simple requirements which you have to do and doesn’t look too hard to be done. The problem however, comes when you have to do the same things, not similar, but exactly the same configurations given as above on those 1000 RHEL 8 systems.

And not to mention that there can be a human error or configuration drift, for example, a different version being installed on a system. If we can automate this management, think about the time you can save.

Apache happens to be just an example. You can do a looottt more than that. You can manage storage, cloud platforms, databases, put security policies in place, user management, package management, network and firewall management application deployments and all other kinds of stuff that you can think of.

This is where we talk about the buzzword, IAC, or Infrastructure As Code. And that is where a configuration management and automation tool comes into the picture, which is Ansible.

Ansible is a way to fully automate the life cycle of your application management, starting all the way from provisioning the servers, applying updates, installing applications, deploying the application, do integration and unit tests and also installing the monitoring agents that checks the health of application, if needed, in a secure, easy and controlled way.

And as it is a code for your infrastructure, nothing is done manually. Hence all the 1000 servers will have the same configuration as each other, thus removing the chances of the servers having any configuration drift.

Ansible works on declarative approach, where rather than saying how to do, you say the what to do, or precisely, what state the systems should be in, which makes it easily human readable. Even if you have zero coding experience, you can start working with Ansible and manage your infrastructure.

So just run the playbooks ( yeah, the code in yaml ) on the servers ( managed hosts ) across your inventory ( file containing the IP addresses of servers). It will connect to your systems, manage them in parallel ( or one by one, in case of a rolling update scenario ) and get yourself a really nice cup of coffee..!!! ;)

It is really that simple. Now whether you want to play foosball or FIFA while it is automating, it is totally up to you :D

shubhamkatara

Automation with Ansible

Shubham Katara

Written by

Red Hat Certified Architect | Red Hat Certified Instructor | Red Hat Certified Examiner | Linux Foundation Certified Engineer

shubhamkatara

Automation with Ansible

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade