Ansible: changing world

Bhavesh Kumawat
5 min readJan 1, 2021

What is ansible?

Ansible is a universal language, unraveling the mystery of how work gets done. Turn tough tasks into repeatable playbooks. Roll out enterprise-wide protocols with the push of a button.

ansible

Ansible is an open-source automation tool, or platform, used for IT tasks such as configuration management, application deployment, intraservice orchestration, and provisioning. Automation is crucial these days, with IT environments that are too complex and often need to scale too quickly for system administrators and developers to keep up if they had to do everything manually. Automation simplifies complex tasks, not just making developers’ jobs more manageable but allowing them to focus attention on other tasks that add value to an organization. In other words, it frees up time and increases efficiency. And Ansible, as noted above, is rapidly rising to the top in the world of automation tools. Let’s look at some of the reasons for Ansible’s popularity.

Now that we have seen what is Ansible, let us find out the various advantages of Ansible.

Advantages of Ansible

  • Free: Ansible is an open-source tool.
  • Very simple to set up and use: No special coding skills are necessary to use Ansible’s playbooks (more on playbooks later).
  • Powerful: Ansible lets you model even highly complex IT workflows.
  • Flexible: You can orchestrate the entire application environment no matter where it’s deployed. You can also customize it based on your needs.
  • Agentless: You don’t need to install any other software or firewall ports on the client systems you want to automate. You also don’t have to set up a separate management structure.
  • Efficient: Because you don’t need to install any extra software, there’s more room for application resources on your server.

Ansible Architecture

1. Modules

Modules are like small programs that Ansible pushes out from a control machine to all the nodes or remote hosts. The modules are executed using playbooks (see below), and they control things such as services, packages, and files. Ansible executes all the modules for installing updates or whatever the required task is, and then removes them when finished. Ansible provides more than 450 modules for everyday tasks.

2. Plugins

As you probably already know from many other tools and platforms, plugins are extra pieces of code that augment functionality. Ansible comes with a number of its plugins, but you can write your own as well. Action, cache, and callback plugins are three examples.

3. Inventories

All the machines you’re using with Ansible (the control machine plus nodes) are listed in a single simple file, along with their IP addresses, databases, servers, and so on. Once you register the inventory, you can assign variables to any of the hosts using a simple text file. You can also pull inventory from sources like EC2 (Amazon Elastic Compute Cloud).

4. Playbooks

Ansible playbooks are like instruction manuals for tasks. They are simple files written in YAML, which stands for YAML Ain’t Markup Language, a human-readable data serialization language. Playbooks are really at the heart of what makes Ansible so popular is because they describe the tasks to be done quickly and without the need for the user to know or remember any particular syntax. Not only can they declare configurations, but they can orchestrate the steps of any manually ordered task, and can execute tasks at the same time or at different times.

Each playbook is composed of one or multiple plays, and the goal of a play is to map a group of hosts to well-defined roles, represented by tasks.

5. APIs

Various APIs (application programming interfaces) are available so you can extend Ansible’s connection types (meaning more than just SSH for transport), callbacks, and more.

Now that we’ve come this far to understand what Ansible is, let us next look into the Ansible tower.

Industries success stories

HOOTSUITE

Hootsuite is a social media management system used by businesses and organizations. It allows the execution of social media campaigns on a variety of networks from a secure dashboard. Hootsuite is popular among Fortune 1000 companies.

hootsuite logo

The main challenge facing Hootsuite was the lack of repeatability. This made automating Hootsuite’s infrastructure a challenge, and Hootsuite were also facing difficulties in application deployment.

To resolve this, Hootsuite introduced Ansible core. This allowed Hootsuite to build servers from scratch and enabled repeatability. In the future, Hootsuite plans to implement an Ansible migration of its app deployment and possibly in ad hoc production server management.

Since performing their Ansible migration, Hootsuite says ops and devs ‘feel safer’. Additionally, Ansible allows developers to repeatedly test server builds on a local level until the team can be sure they work.

Hootsuite intends to use Ansible in many other ways, and as Beier Cai, Director of Technology, Hootsuite Media Inc., explains, “In the beginning I didn’t realize Ansible is good for orchestration as well but found it out quickly and I really loved it as it beats competitors right there.”

LIFESUM

Based in Stockholm, Lifesum is a digital health platform that encourages users to lead a healthier, more balanced lifestyle. Lifesum has proved hugely successful throughout Europe, reaching over 6 million downloads so far.

Lifesum’s platform uses a host of applications, in addition to a joint back end API, and it bases its infrastructure on AWS. Lifesum was looking for a simplified yet robust tool to allow configuration management, application deployment, and server provisioning.

lifesum logo

Prior to introducing Ansible, Lifesum had used another tool but found provisioning and managing different environments a challenge.

Lifesum started their Ansible migration in 2014. It started implementing Ansible straight away and has used it in several major areas. First, Lifesum used Ansible playbooks “to automatically spin up virtual development machines with Vagrant”.

In the case study, Michal Gasek, SYSOPS Engineer/DBA at Lifesum also notes that Lifesum’s goal, “[is] to ensure that everyone had exactly the same working environment as we deploy our applications regularly. Three months later all our environments, from developer’s laptops to production instances on Amazon, [are] fully Ansible managed.”

Gasek continues, “We use AWS Auto Scaling and pre-bake Amazon AMI images with Ansible provisioning playbooks. When EC2 instances are launched by Auto Scaling, Ansible, triggered by cloud-init, runs provisioning playbooks, once again ensuring up-to-date configuration changes are applied, and pulling the latest applications versions from repositories. Ansible has helped us to automate, significantly simplify and speed up the process of dynamic resources scaling”.

Gasek adds that Ansible stood out because of its ‘power and simplicity’. Gasek also highlights how Ansible has enabled developers to concentrate on building ‘great product features’, rather than solving common problems like inconsistencies and misconfiguration.

--

--