Ansible -Why is it so powerful and popular?

Deepak Patra
5 min readDec 1, 2020

What is ansible?

Ansible is an open-source IT automation engine, which can remove drudgery from your work life, and will also dramatically improve the scalability, consistency, and reliability of your IT environment. 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 has three main files that you need to consider:

Host/inventory file: Contains the entry of the nodes that need to be managed

Ansible.cfg file: Located by default at /etc/ansible/ansible.cfg, it has the necessary privilege escalation options and the location of the inventory file

Main file: A playbook that has modules that perform various tasks on a host listed in an inventory or host file.

Modules:

Modules (also referred to as “task plugins” or “library plugins”) are discrete units of code that can be used from the command line or in a playbook task. Ansible executes each module, usually on the remote managed node, and collects return values. Ansible comes with hundreds of inbuilt modules and modules are those pieces of code that get executed when you run a playbook.

Playbooks:

Playbooks are the files where Ansible code is written. Playbooks are written in YAML format. YAML stands for Yet Another Markup Language. Playbooks are one of the core features of Ansible and tell Ansible what to execute. They are like a to-do list for Ansible that contains a list of tasks. A playbook contains plays, a play contains different tasks, and a task includes modules.

Playbooks use YAML, a human-readable data serialization language. YAML is a recursive acronym that stands for “YAML Ain’t Markup Language.”

Pluggins:

Plugins here are special kind of modules. These plugins get executed before a module is getting executed on the nodes. Plugins get executed on the main control machine for logging purposes.

Ansible Architecture:

The above architecture shows bunch of host machines to which ansible server connects and pushes the playbooks through SSH.

What is configuration management?

Configuration management is a process for maintaining computer systems, servers, and software in a desired, consistent state. It’s a way to make sure that a system performs as it’s expected to as changes are made over time. The role of configuration management is to maintain systems in a desired state.

Why ansible beacame so popular?

Although Ansible is a young product, it already has wide acceptance among IT experts because of its simplicity and flexibility. Ansible is a simple automation language that is easy-to-learn, self-documenting and doesn’t require a grad-level computer science degree to read. Ansible can be used to update programs and configuration on hundreds of servers at once, but the process is the same whether you’re managing one computer or dozens.

One of the reasons Ansible is winning the day against other automation mechanisms is that it is significantly easier for an untrained operations-type person that is not a coder to be able to automate using Ansible.

The primary benefit of Ansible is it allows IT administrators to automate away the drudgery from their daily tasks.

Ansible in GCP & AWS:

▶Ansible and Google have been working together on a set of auto-generated Ansible modules designed to manage Google Cloud Platform resources, including creating instances, controlling network access, working with persistent disks, managing load balancers, and a lot more.

▶Red Hat has partnered with Google to ship a new set of modules for automating Google Cloud Platform resource management. The partnership has resulted in more than 100 GCP modules.

▶Ansible is an open source tool that you can use to automate your AWS deployments. You can use it to define, deploy, and manage applications and services using automation playbooks. These playbooks enable you to define configurations once and deploy those configurations consistently across environments.

▶Ansible provides a dynamic host inventory by which we can select hosts regardless of where hosts were created.

▶When using Ansible, there are dozens of modules you can choose from that support AWS services. These modules include functionality for:

  • Autoscaling groups
  • CloudFormation, CloudTrail, and CloudWatch
  • DynamoDB, ElastiCache, and Relational Database Service (RDS)
  • Elastic Cloud Compute (EC2)
  • Identity Access Manager (IAM) and Security Groups
  • AWS Lambda
  • Simple Storage Service (S3)
  • Virtual Private Cloud (VPC)

Datacom uses Red Hat Ansible Automation:

Datacom has grown over five decades to become one of Asia Pacific’s leading locally owned IT-based service providers. This has enabled Datacom to provide a broad range of services and solutions including software development, cloud advisory, datacenter operations, payroll and customer experience design, IT services and security management.

Because Ansible was getting the attention of many Datacom customers, the company chose to focus on using Ansible as the orchestration glue for automation. Datacom constructed the platform which made it easily consumable while allowing customers to leverage the automation elements. Datacom is witnessing application developers use the infrastructure stack to deploy the apps on different technologies.

NASA:

NASA needed to move roughly 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-is’ to a cloud environment. In order to manage the multi cloud created , Ansible played a key role and allowed them to provide better operations and security to their clients. It has also increased their efficiency as a team.

Thanks for reading!!

Keep Learning and sharing…..

--

--