Ansible Automation

In this article, we will discuss what is ansible in DevOps and its use cases? If anyone asks you about ansible you can say simply this is an automation tool. But he/she can ask again there is a lot of automation tools like Jenkins, Nagios, Docker, Kubernetes so what is new in ansible? Simply you can say that all these tools are also automation tools, but it’s depended on you what kind of automation you want to achieve like if you want to automate your monitoring then use Nagios. If you want to automate your deployment and testing, then use Jenkins. Similarly, if you want to automate your configuration level task then use ansible.

Ansible omWhat is Ansible?

Ansible is a software tool that provides simple but powerful automation for cross-platform computer support. It is primarily intended for IT professionals, who use it for application deployment, updates on workstations and servers, cloud provisioning, configuration management, intra-service orchestration, and nearly anything a systems administrator does on a weekly or daily basis. Ansible doesn’t depend on agent software and has no additional security infrastructure, so it’s easy to deploy.

How Ansible works?

In Ansible, there are two categories of computers: the control node and managed nodes. The control node is a computer that runs Ansible. There must be at least one control node, although a backup control node may also exist. A managed node is any device being managed by the control node.

Why Ansible?

How Ansible Works?

Who uses Ansible?

1530 companies reportedly use Ansible in their tech stacks, including LaunchDarkly, Tokopedia, and ViaVarejo.

  • Tokopedia.
  • ViaVarejo.
  • trivago.
  • Revolut.
  • Alibaba Travels.
  • Typeform.
  • Pratilipi.

PROVISIONING

Your apps have to live somewhere. If you’re PXE booting and kickstarting bare-metal servers or VMs, or creating virtual or cloud instances from templates, Ansible and Red Hat® Ansible® Tower help streamline the process.

CONFIGURATION MANAGEMENT

Centralizing configuration file management and deployment is a common use case for Ansible, and it’s how many power users are first introduced to the Ansible automation platform.

APPLICATION DEPLOYMENT

When you define your application with Ansible, and manage the deployment with Ansible Tower, teams are able to effectively manage the entire application lifecycle from development to production.

SECURITY AUTOMATION

When you define your security policy in Ansible, scanning and remediation of site-wide security policy can be integrated into other automated processes and instead of being an afterthought, it’ll be integral in everything that is deployed.

ORCHESTRATION

Configurations alone don’t define your environment. You need to define how multiple configurations interact and ensure the disparate pieces can be managed as a whole. Out of complexity and chaos, Ansible brings order.

CONTINUOUS DELIVERY

Creating a CI/CD pipeline requires buy-in from numerous teams. You can’t do it without a simple automation platform that everyone in your organization can use. Ansible Playbooks keep your applications properly deployed (and managed) throughout their entire lifecycle.

Microsoft Azure

We all know about Microsoft Azure very well and Ansible is helping this public cloud to automate things. Ansible’s library of Azure modules makes it easy to provision instances, networks, and complete Azure infrastructure whenever you need, and in any region you require. For example, the same simple Playbook language you use for application deployment and on-prem automation also provisions your Azure infrastructure, applying the correct configuration. So Azure deploys once and can use anywhere through the Ansible automation. Azure also uses this tool to scale its services and Ansible has modules for many different Azure capabilities, including.

Ansible Automation & Architecture

Ansible is an SCM tool and is used to automate repetitive tasks that is usually done on a server. Ansible SCM tool consists 3 core subsystems: ACS (Ansible Control Server), Ansible Inventory and Ansible Playbooks. Before seeing a live example, it would be better to understand these Ansible terms and architecture a bit so can go with it.

NASA using Ansible

The Challenge Before Ansible

  • Migrating 110 websites & apps to Amazon in 22 weeks.
  • Everything was manual, following tasks documents. With time — started using shell scripts. Simple things were extremely burdensome.

How NASA is using Ansible?

To solve the problems that we had with a lack of centralized management and a diverse environment, they evaluated multiple solutions and decided on the implementation of Ansible Tower. They are now leveraging Ansible Tower to manage their environment in a very organized and scheduled way. As a result of their Ansible Tower implementation they achieved the following efficiencies:

Results after Ansible

As a result of implementing Ansible is better equipped to manage their environment. Ansible has allowed them to provide better operations and security to their clients. It increased their efficiency as a team.