Ansible Industrial Use Case.

Siddhi Dhamale
5 min readDec 30, 2020

This Article is all about one of the great and widely used tool called Ansible.Recently I attended a live webinar organised by Vimal Sir ,given by two Redhat experts-Sreejith Anujan and Arun Eapen.

This webinar helped me to know ample of use cases of Ansible via practical implementation and I would love to share that with you all.

Webinar started from scratch by letting us understand what is automation?

Definition — What does Automation mean?

IT automation is the use of instructions to create a repeated process that replaces an IT professional’s manual work in data centers and cloud deployments. Software tools, frameworks and appliances conduct the tasks with minimum administrator intervention. The scope of IT automation ranges from single actions to discrete sequences and, ultimately, to an autonomous IT deployment that takes actions based on user behavior and other event triggers.

Then we came to the Main topic What is Ansible?

What is Ansible?

Ansible is an open source automation platform. It is very, very simple to setup and yet powerful. Ansible can help you with configuration management, application deployment, task automation. It can also do IT orchestration, where you have to run tasks in sequence and create a chain of events which must happen on several different servers or devices. An example is if you have a group of web servers behind a load balancer. Ansible can upgrade the web servers one at a time and while upgrading it can remove the current web server from the load balancer and disable it in your Nagios monitoring system. So in short you can handle complex tasks with a tool which is easy to use.

About Ansible Tower

One of the major gripes from Ansible users is that it didn’t have a proper GUI. And that’s putting it mildly — the GUI was so bad that in the early days it wasn’t even properly synced to the CLI, meaning that the CLI and GUI could give you 2 different query results about the state of a certain node. This was an especially critical issue because good UI is important for occasional and new users to get comfortable and familiar with an application, before diving into the complexities of the CLI and playbook creation. Ansible itself was (and still is) rather new, so most of its users were by definition new users.

Ansible Tower, previously called the AWX project, is the fix to this problem. It is a comprehensive web-based UI for Ansible, containing the most important Ansible features, especially those that render better as graphical rather than text-based output, such as real-time node monitoring.

From Ansible:

Ansible Tower is the easy-to-use UI and dashboard and REST API for Ansible. Centralize your Ansible infrastructure from a modern UI, featuring role-based access control, job scheduling, and graphical inventory management. Tower’s REST API and CLI make it easy to embed Tower into existing tools and processes. Tower now includes real-time output of playbook runs, an all-new dashboard and expanded out-of-the-box cloud support.

Some of the important features of Ansible Tower are listed below. The full feature list is available off the Ansible website.

  1. Role-based access control: you can set up teams and users in various roles. These can integrate with your existing LDAP or AD environment.
  2. Job scheduling: schedule your jobs and set repetition options
  3. Portal mode: this is a simplified view of automation jobs for newbies and less experienced Ansible users. This is an excellent feature as it truly lowers the entry barriers to starting to use Ansible.
  4. Fully documented REST API: allows you to integrate Asible into your existing toolset and environment
  5. Tower Dashboard: use this to quickly view a summary of your entire environment. Simplifies things for sysadmins while sipping their coffee.
  6. Cloud integration: Tower is compatible with the major cloud environments: Amazon EC2, Rackspace, Azure.

In short, Ansible Tower is a remarkably useful add-on to Ansible, able to do much of what can be done on the CLI. It will complement, not replace, the main application by automating and presenting some of the main tasks graphically — especially the monitoring-dashboard types of tasks. As a major bonus, it also greatly helps to reduce the intimidation factor for those new to Ansible by presenting a much easier to understand visual tool. But for playbook creation, Ansible’s CLI is still your best option.

Ansible Tower Integration with slack:

Chat bots are awesome! if you are using Slack, then you’ll know what I’m talking about. Bots are in many ways similar to their human counterparts: they have names, profile pictures, and you can even mention them in your chats. But, there is a marked difference between a chat bot and a normal user, instead of interacting to your team via Slack’s mobile or desktop apps, bots are controlled programmatically via a bot user token that accesses one or more of Slack’s APIs.

Don’t we all love APIs? You can easily interface with Slack chat bots via APIs from some of the top open source configuration/orchestration management tools like Ansible, Chef and Puppet. The obvious question here is, why do I need a notification on my slack channel? Well, Slack can make your life much easier if you are part of a team that spans across the globe. Collaboration will no longer be a desired end state, it will become a work culture. Many a time, we just need to send a simple message to each other to update the others on the progress of some task. We are doing this via email, Skype, and even texts. Although certain progress needed to be communicated to one person, we wanted more transparency because it helps our team if everyone is made aware of what’s going on in all sides of the business in order to either interject, ask a question, or for individuals to plan their own work around what was being done elsewhere.

With the advent of Devops practices, we have essentially changed the way we build and deploy solutions. At any given time, there is just so much going on in your Cloud environment and you want to keep a tab only on pieces that are important to you. This article will walk you through the steps involved in setting up Ansible tower to deliver notifications to a specific slack channel via chat bot whenever a job runs.

--

--