How ansible helps in solving challenges faced by big industries?

Deepak Sharma
12 min readJan 2, 2021

In this article , you can learn how ansible is solving the challenges for Industries and why Ansible is so famous in the DevOps World.

Introduction

1. 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.

2. History of Ansible

  • Michael DeHaan developed Ansible, and the Ansible project began in February 2012.
  • The creator of Cobbler and Func is also the controller of the Fedora Unified network.
  • RedHat acquired the Ansible tool in 2015.
  • Ansible is included as part of the Fedora distribution of the Linux.
  • Ansible is also available for RedHat Enterprise Linux, Debian, CentOS, Oracle Linux, and Scientific Linux via Extra Packages for Enterprise Linux (EPEL) and Ubuntu as well as for other operating systems.

3. How Ansible Works ?

Ansible is used to configure Managed Node by SSH protocol
  • In Ansible, there are two categories of computers: the controller node and managed nodes. The controller node is a computer that runs Ansible. There must be at least one controller node, although a backup control node may also exist. A managed node is any device being managed by the control node.
  • Ansible works by connecting to nodes (clients, servers, or whatever you’re configuring) on a network, and then sending a small program called an Ansible module to that node and and behind the scene call the operating system’s respective command to complete the task. That’s why ansible’s one code(playbook) can be use for different types of operating systems.
  • Ansible executes these modules over SSH and removes them when finished. The only requirement for this interaction is that your Ansible control node has login access to the managed nodes.
  • SSH keys are the most common way to provide access, but other forms of authentication are also supported.

4. Why we need Ansible ?

  • Automation is an essential and strategic component of modernization and digital transformation. Modern, dynamic environments need a new type of management solution that can improve speed, scale and stability across the enterprise IT environment.
  • Technology is our most effective innovation tool which aids in improving the performance of products. Historically to achieve this required a lot of manual effort and complicated coordination. But today, Ansible — the simple, yet powerful IT automation engine that thousands of companies are using to drive complexity out of their environments and accelerate DevOps initiatives.

5. Ansible Terms :-

  1. Controller Machine: The machine where Ansible is installed, responsible for running the provisioning on the servers you are managing.
  2. Inventory: The Inventory is a description of the nodes that can be accessed by Ansible. By default, the Inventory is described by a configuration file, in INI or YAML format, whose default location is in /etc/ansible/hosts. The configuration file lists either the IP address or hostname of each node that is accessible by Ansible. In addition, nodes can be assigned to groups.
  3. Playbook: Aplaybook is a configuration file written in YAML that provides instructions for what needs to be done in order to bring a managed node into the desired state.
  4. Task: A block that defines a single procedure to be executed, e.g. Install a package.
  5. Module: Modules are mostly stand alone and can be written in a standard scripting language (such as Python, Perl, Ruby, Bash, etc.). Ansible modules are idempotency in nature, which means that even if an operation is repeated multiple times, it will always place the system into the same state.
  6. Role: A pre-defined way for organizing playbooks and other files in order to facilitate sharing and reusing portions of a provisioning.
  7. Play: A provisioning executed from start to finish is called a play. In simple words, execution of a playbook is called a play.
  8. Facts: Global variables containing information about the system, like network interfaces or operating system.
  9. Handlers: Used to trigger service status changes, like restarting or stopping a service.
  10. Hosts: — In the Ansible architecture, hosts are the node systems, which are automated by Ansible, and any machine such as RedHat, Linux, Windows, etc.

Advantages of using ansible

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

Ansible Architecture

The Ansible orchestration engine interacts with a user who is writing the Ansible playbook to execute the Ansible orchestration and interact along with the services of private or public cloud and configuration management database.

Ansible architecture (How ansible internally works?)

It uses no agents and no additional custom security infrastructure, so it’s easy to deploy — and most importantly, it uses a very simple language (YAML, in the form of Ansible Playbooks) that allow you to describe your automation jobs in a way that approaches plain English.

Terms are used in ansible-architecture :-

1. Inventory

Inventory is lists of nodes or hosts having their IP addresses, databases, servers, etc. which are need to be managed.

2. API’s

The Ansible API’s works as the transport for the public or private cloud services.

3. Modules

Ansible connected the nodes and spread out the Ansible modules programs. Ansible executes the modules and removed after finished. These modules can reside on any machine; no database or servers are required here. You can work with the chose text editor or a terminal or version control system to keep track of the changes in the content.

4. Plugins

Plugins is a piece of code that expends the core functionality of Ansible. There are many useful plugins, and you also can write your own.

5. Playbooks

Playbooks consist of your written code, and they are written in YAML format, which describes the tasks and executes through the Ansible. Also, you can launch the tasks synchronously and asynchronously with playbooks. Playbooks contain the steps which the user wants to execute on a particular machine. And playbooks are run sequentially. Playbooks are the building blocks for all the use cases of Ansible.

6. Hosts

In the Ansible architecture, hosts are the node systems, which are automated by Ansible, and any machine such as RedHat, Linux, Windows, etc.

7. Networking

Ansible is used to automate different networks, and it uses the simple, secure, and powerful agentless automation framework for IT operations and development. It uses a type of data model which separated from the Ansible automation engine that spans the different hardware quite easily.

8 Cloud

A cloud is a network of remote servers on which you can store, manage, and process the data. These servers are hosted on the internet and storing the data remotely rather than the local server. It just launches the resources and instances on the cloud, connect them to the servers, and you have good knowledge of operating your tasks remotely.

9. CMDB

CMDB is a type of repository which acts as a data warehouse for the IT installations.

Ansible Use in IT Automation

Ansible seamlessly unites workflow orchestration with configuration management, provisioning, and application deployment in one easy-to-use and deploy platform.

Regardless of where you start with Ansible, you’ll find our simple, powerful and agentless automation platform has the capabilities to solve your most challenging problems.

1. Provisioning

Provisioning with Ansible allows you to seamlessly transition into Configuration Management, orchestration and application deployment using the same simple, human readable, automation language.

2. Configuration Management

Ansible configurations are simple data descriptions of your infrastructure (both human-readable and machine-parsable) — ensuring everyone on your team will be able to understand the meaning of each configuration task. New team members will be able to quickly dive in and make an impact. Existing team members can get work done faster — freeing up cycles to attend to more critical and strategic work instead of configuration management.

3. Application Deployment

Ansible is the simplest way to deploy your applications. It gives you the power to deploy multi-tier applications reliably and consistently, all from one common framework. You can configure needed services as well as push application artifacts from one common system.

Rather than writing custom code to automate your systems, your team writes simple task descriptions that even the newest team member can understand on first read — saving not only up-front costs, but making it easier to react to change over time.

4. Continuous Delivery

Ansible is the simplest way to deploy your applications. It gives you the power to deploy multi-tier applications reliably and consistently, all from one common framework. You can configure needed services as well as push application artifacts from one common system.

Rather than writing custom code to automate your systems, your team writes simple task descriptions that even the newest team member can understand on first read — saving not only up-front costs, but making it easier to react to change over time.

  • The CI asks Ansible to run a playbook that deploys a staging environment with the application.
  • When the stage tests pass, it might then be asked to run a production deployment.
  • Ansible can check out your artifacts from version control on each machine, or pull artifacts from the CI server, or from a package mirror.

5. 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.

6. 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. But no one deploys a single service on a single machine any more. Today’s IT brings complex deployments and complex challenges. You’ve got to deal with clustered applications, multiple datacenters, public, private and hybrid clouds and applications with complex dependencies. You need a tool that can orchestrate your complex tasks simply. You need Ansible.

Ansible For Cloud Computing

Ansible’s library of cloud support modules makes it easy to provision instances, networks, and complete cloud infrastructure wherever you need. The same simple Playbook language you use for application deployment and on-premise virtualization automation also provisions your infrastructure, and applies the correct configuration to it. Ansible ensures your cloud deployments work seamlessly across public, private, or hybrid cloud as easily as you can build a single system.

1. Provisioning cloud infrastructures with Ansible is easy

Clouds are more than just servers. Regardless if your application environment just consists of servers, or servers, specific OS configurations, virtual private networks, subnets, and even load balancers — Ansible will ensure the infrastructure meets every need of your application each and every time.

Deploying your clouds with Ansible takes out the guesswork from the process. You don’t have to spend time educating entire teams on how to work with each cloud vendor in your environment, and you can trust that every deployment meets all of your policy each and every time.

2. Clouds are more than just servers

The modularity of Ansible’s code base allows Ansible to manage today’s infrastructure, but also rapidly adapt to new IT needs and requirements from the clouds of tomorrow. Ansible includes over 300 modules spanning hundreds of API endpoints in various public and private cloud technologies and vendors. From OpenStack to AWS to GCP and Azure, Ansible has the capabilities you need to effectively deploy and manage your infrastructure, including:

  • Servers and operating
  • Cloud-native routing and networking
  • Virtual private networks
  • Access policy and permissions
  • Load balancers
  • Auto-scaling policy

3. Ansible With Google Cloud Platform

Google Cloud Platform (GCP) provides scalable infrastructure and solutions to meet the needs of your organization. GCP offers on-demand instances, software-defined networking, storage and databases, and big data solutions — and they’re all available at your fingertips. GCP enables your applications to take advantage of Google’s significant infrastructure, utilizing their best-of-breed technology and innovation, and only pay for what you need when you need it.

a. Ansible and Google Native Integration

The Ansible + GCP Integration gives you everything you need to manage your IT infrastructure. From provisioning instances and auto-scaling, custom networks and load balancing, and even managing DNS and cloud storage, it’s all provided.

b. Ansible Automation Solutions For GCP Cloud :

i. Testing/Continuous Integration

  • Use Ansible to launch instances in any GCP Zone, configure networking setups to accurately simulate real-world scenarios
  • Deploy your code how you want: private disk images, startup scripts pointing to your own package repository and more — all within your native Ansible Playbooks
  • Tear-down instances when you’re done: right after a test or after a review with the team and even keep a snapshot of the disk

ii. Production Deployment

  • Use GCP Managed Instance Groups Playbook and auto scaling to ensure your application can meet the needs of its users
  • Easily use Cross-Zone Load Balancing to have your application served by the closest-available zone
  • Enable Service Accounts with specific access, enabling only those who need it to run your playbooks in production

How companies benefits by Ansible

1. HCA Healthcare :-

  • HCA Healthcare, one of the largest healthcare service providers in the United States, uses data and technology to support modern healthcare. A cross-functional team of clinicians, data scientists, and technology professionals at HCA Healthcare used Red Hat solutions to create a real-time predictive analytics product system to more accurately and rapidly detect sepsis, a potentially life-threatening condition.
  • Saving lives by creating big data analysis platform to speed sepsis detection
  • Created reliable, highly available container environment for new services and real-time machine learning algorithms
  • Established supported yet flexible environment for learning health system.

2. Arista :-

  • Arista’s software-driven cloud networking model is helping to redefine cloud architectures as data centers adapt to achieve better agility and economy. Arista enables the use of standard provisioning and automation systems such as Ansible through our open Linux approach, bringing Net-Ops and Dev-Ops unification.
  • So here Ansible helps Arista to improve speed and accuracy as well as when Arista uses Ansible it doesn’t require third-party EOS extensions and additional switch configuration. Arista has complete control of your configuration with idempotency built-in with Ansible that makes it intelligent, dynamic decisions in your playbook. Now Arista enables continuous compliance of EOS configuration with the configuration of Ansible.

3. CISCO :-

As customers embrace the DevOps model to accelerate application deployment and achieve higher efficiency in operating their data centers, the infrastructure needs to change and respond faster than ever to business needs. These changes can help you achieve an agile operational model by improving automation, innovation, and consistency. Cisco is providing the some best services with the help of Ansible which are the following

  • Speed IT Transformation
  • Leverage Open Ecosystem
  • Efficient Operational Model
  • Faster Adoption
  • Improve Speed and Agility

4. Amazon Web Services (AWS) :-

Ansible is used to define, deploy, and manage a wide variety of services. Most complicated AWS environments can be provisioned very easily using a playbook. The best feature is, you create a server-host connection and then run the playbook on just one system and provision multiple other systems with an option to scale up and scale down as per requirement.

Ansible has hundreds of modules supporting AWS and some of them include:

  • Auto-scaling groups
  • Cloud-Formation
  • Cloud-Trail
  • Cloud-Watch
  • DynamoDB
  • ElastiCache
  • Elastic Cloud Compute (EC2)
  • Identity Access Manager (IAM)
  • Lambda
  • Relational Database Service (RDS)
  • Route53
  • Security Groups
  • Simple Storage Service (S3)
  • Virtual Private Cloud (VPC)
  • And many more

As well as Ansible provides dynamic inventory and safe automation for AWS. That’s why Ansible is solving the many challenges as you have seen above.

5. Lenovo :-

  • The Ansible integration with CNOS switches brings high-speed cloud workflow automation to the datacenter. Lenovo developed modules, sample Playbooks, and roles that support most configuration functions of CNOS switches.
  • Ansible’s modules and roles are used to create simple, easy to read playbooks that automate repetitive tasks and allows orchestration of complex configurations. So The combined Ansible and Lenovo solution provides high-speed, Simplicity, Knowledge, and controller network infrastructures and best management to the customers.

Conclusion :-

Ansible is a powerful automation that allows them to model and deliver any configuration, any deployment, any environment across their IT infrastructure. Ansible solves problems once and share the results with everyone. Ansible breaks down silos, creates a culture of automation. Ansible automates the technologies you already use.

Thanks,

--

--

Deepak Sharma
0 Followers

5x RedHat Certified Engineer (EX200, EX294, EX180, EX280, RH358) || DevOps Engineer || Docker, K8s, Ansible, Git & Github , Gitlab, Terraform || Jenkins || AWS