Ansible in real world!

Vibhanshusharma
7 min readDec 11, 2020

Basics of Ansible-

Ansible is an open source IT Configuration Management, Deployment & Orchestration tool. It aims to provide large productivity gains to a wide variety of automation challenges. This tool is very simple to use yet powerful enough to automate complex multi-tier IT application environments.

Ansible Terminology-

  • Controller Machine: The machine where Ansible is installed, responsible for running the provisioning on the servers you are managing.
  • Inventory: An initialization file that contains information about the servers you are managing.
  • Playbook: The entry point for Ansible provisioning, where the automation is defined through tasks using YAML format.
  • Task: A block that defines a single procedure to be executed, e.g. Install a package.
  • Module: A module typically abstracts a system task, like dealing with packages or creating and changing files. Ansible has a multitude of built-in modules, but you can also create custom ones.
  • Role: A pre-defined way for organizing playbooks and other files in order to facilitate sharing and reusing portions of a provisioning.
  • Play: A provisioning executed from start to finish is called a play. In simple words, execution of a playbook is called a play.
  • Facts: Global variables containing information about the system, like network interfaces or operating system.
  • Handlers: Used to trigger service status changes, like restarting or stopping a service

Advantages-

Simple: Ansible uses a simple syntax written in YAML called playbooks. YAML is a human-readable data serialization language. It is extraordinarily simple. So, no special coding skills are required and even people in your IT organization, who do not know what is Ansible can likely read a playbook and understand what is happening.

Simple: Ansible uses a simple syntax written in YAML called playbooks. YAML is a human-readable data serialization language. It is extraordinarily simple. So, no special coding skills are required and even people in your IT organization, who do not know what is Ansible can likely read a playbook and understand what is happening.

Powerful & Flexible: Ansible has powerful features that can enable you to model even the most complex IT workflows. In this aspect, Ansible’s batteries included approach (This philosophy means that something is self-sufficient, comes out-of-the-box ready to use, with everything that is needed) can manage the infrastructure, networks, operating systems and services that you are already using, as Ansible provides you with hundreds of modules to manage them. Together Ansible’s capabilities allow you to orchestrate the entire application environment regardless of where it is deployed.

Powerful & Flexible: Ansible has powerful features that can enable you to model even the most complex IT workflows. In this aspect, Ansible’s batteries included approach (This philosophy means that something is self-sufficient, comes out-of-the-box ready to use, with everything that is needed) can manage the infrastructure, networks, operating systems and services that you are already using, as Ansible provides you with hundreds of modules to manage them. Together Ansible’s capabilities allow you to orchestrate the entire application environment regardless of where it is deployed.

Ansible use case in real world-

1-NASA

NASA needed to move 65 applications from a traditional hardware based data center to a cloud-based environment for better agility and cost savings. The rapid timeline resulted in many applications being migrated ‘as it is’ to a cloud environment. This created an environment which spanned multiple virtual private clouds (VPCs) and AWS accounts that could not be managed easily. Even simple things, like ensuring every system administrator had access to every server, or simple security patching, were extremely cumbersome.

The solution was to leverage Ansible Tower to manage and schedule the cloud environment.

Hence, to solve the problems that NASA had with lack of centralized management and a diverse environment, they evaluated multiple solutions and decided on an implementation of Ansible Tower. NASA is now leveraging Ansible Tower to manage their environment in a very organized and scheduled way.

Ansible Tower provided with a dashboard which provided the status summary of all hosts and jobs which allowed NASA to group all contents and manage access permissions across different departments. It also helped to split up the organization by associating content and control permission for groups as well.

Ansible Tower is a web-based interface for managing Ansible. One of the top items in Ansible users’ wishlists was an easy-to-use UI for managing quick deployments and monitoring one’s configurations. Ansible management came up with Ansible Tower in response.

Further, Ansible divided the tasks among teams by assigning various roles. It managed the clean up of old job history, activity streams, data marked for deletion and system tracking info

As a result of implementing Ansible, NASA is better equipped to manage its AWS environment. Ansible allowed NASA to provide better operations and security to its clients.

2- Hootsuite

HootSuite is a social media management system for businesses and organizations to collaboratively execute campaigns across multiple social networks from one secure, web-based dashboard. More than 75% of Fortune 1000 companies now use HootSuite for social media management, social marketing, social customer service, and social selling. Customers include PepsiCo, Virgin, FOX, Sony Music, and WWF.

The Problem:

The infrastructure is not scripted, repeatable or immutable. Rebuilding a server relies on limited documentation and mostly memory. Lack of repeatability made automating the infrastructure and application deployment difficult.

The Fix:

They mostly use Ansible core at this time. They currently are applying Ansible to all of their servers, in order to build any server from scratch and repeat this as many times as one wants to. Their future plan is to use Ansible for app deployment, and maybe even ad hoc production server management.

3-Cisco Automation

The Problem:

They had three different reasons they looked at Ansible originally. One was to remove non-value-add work that’s wrapped around user management, things of that nature. The second thing looked at from an Ansible perspective or automation perspective was we were starting a Cisco ACI journey. How do we deploy Cisco ACI in a way that was consistent and reliable and we trusted? The last one was, how to make our engineers’ lives better? Our engineers do a lot of work that’s again, non-value-add, but takes time from them.

The Fix:

So originally before they had Ansible, they had a number of different configuration management tools to do some level of automation. The other thing we had a lot of was engineers having their own scripts, their own methodologies for running their own automations, but it was very siloed, so an engineer may have one automation, another engineer may have another automation. There wasn’t a lot of sharing.

BENEFITS ACHIEVED BY USING ANSIBLE:

One of the things that Ansible has really allowed us to do is develop a common language of ground IT that works for people of all skillsets. For people that are more experts in the operation specific details of their jobs, they can continue to work at a very high level with the abstractions that Ansible already has in place. By contrast though, if we really need to dig under the hood and do something as a power user, Ansible still relies on common tools like Python and PowerShell that people can still get into.

One of the things that Ansible has really allowed to do is develop a common language of ground IT that works for people of all skillsets. For people that are more experts in the operation specific details of their jobs, they can continue to work at a very high level with the abstractions that Ansible already has in place. By contrast though, we really need to dig under the hood and do something as a power user, Ansible still relies on common tools like Python and PowerShell that people can still get into.

One of the things realized when we started using Ansible is not just the cost of what we are doing, but the opportunity cost of what we were leaving on the table. Now that we’ve started automating away the mundane, we’re able to move the organization forward working on initiatives like Cisco ACI, and so some innovative routing things with F5 and other technologies that really leave our organization on the cutting edge.

Because Ansible is so accessible, everybody is now speaking that common tongue when they go to automate their stuff and they’re able to build more things in more impressive ways because they have so many more skillsets.

--

--