MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

How can we use Ansible and where?

Friends, First of all let’s know about Ansible is simple yet powerful. It is a great automation tool and does have great future. It is an open-source automation tool, or platform, used for IT tasks such as configuration management, application deployment, intraservice orchestration, and provisioning. It is one of the most easy to use, versatile and light tool for configuration management as well.

Ansible is a tool that provides:

Ansible provides IT automation, configuration management and automatic deployment across environments

How to Use Ansible?

Below you can see – Ansible consists of 3 main components. A brief explanation of each component is shown below:

Control Machine : It manages the execution of the Playbook. It can be installed on your local machine or on any machine on the internet.
Inventory : It provides a complete list of all the target machines on which various modules are run by doing an ssh connection and install the necessary software.
Playbook : It consists of steps that the control mechanism will perform on the servers defined in the inventory file.

Ansible controller using a playbook and inventory to manage Host1, Host2 and Host3

Ansible is a powerful IT automation tool that you can quickly learn. Its simple enough for everyone in IT yet powerful enough to automate even the most complex deployment.

Simple – Use Case Example

Let’s take a look at a simple use case shown in the following image.

Simple use case: one Ansible controller managing four servers

Now you can imagine you have a number of servers in your environment that you would like to restart in a particular order. Some of them are web servers and others are database servers. So you would like to power down the webserver first followed by the database servers then powerup the database servers and then webservers. You could write an Ansible playbook to get this done in a minute and simply invoke the Ansible playbook every time you wish to restart your applications.

Complex – Use Case Example

Let’s take a look at a complex use case as shown in the following image:

Complex use case: Ansible controller managing server groups in public and private clouds

The main Benefits of Ansible

  • Ansible is fast and performs all functions over SSH and doesn’t require agent installation.
  • You can find Ansible to be a better fit in a larger or more homogeneous infrastructure.
  • It has a collection of modules that can be used to manage various systems as well as cloud infrastructure such as Amazon EC2 and openstack.
  • The main advantage is Ansible can be run from the command line without the use of configuration files for simple tasks, such as making sure a service is running, or to trigger updates or reboots.
  • As long as the box can be ssh’d into and it has python, it can be configured with Ansible.

Roles Directory Structure

Here i let you know about Roles Directory Structure of Ansible, Using Ansible Roles, expect files to be in a certain file structure. The most confusing part of using roles is understanding the file hierarchy. Ansible provides a feature called Ansible Galaxy that helps you play with roles. We already know where our Ansible is on Ubuntu (/etc/ansible). Have you ever seen a directory called roles under /etc/ansible? That directory exists exactly for this reason. You create different roles inside this directory.

The directory will look like this:

Directory tree of /etc/ansible with a mongodb role holding defaults, handlers, tasks, templates and vars

You can create a role using ansible-galaxy init command inside /etc/ansible/roles.

If you are planning to learn Ansible then go with below YouTube channel and get free Videos and Tutorials.

Thank you!

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

How Ansible Automates Cisco IOS and IOS XE Network Devices

Introduction Managing multiple Cisco routers and switches manually can become time-consuming as a network grows. Network engineers regularly configure interfaces, check device status, update settings, and troubleshoot…

Read More

Configuration Management in DevOps: Concepts, Tooling, and a Practical Workflow

This guide explains how configuration management works in modern DevOps teams, compares common tools, and shows a practical Ansible example. It also preserves the original SlideShare reference from the legacy post.

Read More

Configuration Management in DevOps: Workflow, Tool Comparison, and an Ansible Example

This guide explains configuration management for DevOps teams: what it solves, how it fits into delivery workflows, and how major tool options compare. It also includes a practical Ansible example you can adapt for real environments.

Read More

Infrastructure as Code: A Practical Guide for DevOps Professionals

Introduction Managing infrastructure has undergone a massive transformation over the past decade. If you started your career in the era of physical data centers, you likely remember…

Read More

Staff Network Automation Engineer: Role Blueprint, Responsibilities, Skills, KPIs, and Career Path

The Staff Network Automation Engineer is a senior individual contributor in the Cloud & Infrastructure organization responsible for designing, building, and scaling automation systems that make network provisioning, configuration, validation, and operations reliable, fast, and repeatable. The role blends deep networking fundamentals with software engineering practices (version control, CI/CD, testing, observability) to deliver “network as code” capabilities across data center, cloud, and edge environments.

Read More

Top 10 Configuration Management Tools: Features, Pros, Cons & Comparison

Introduction Configuration Management Tools are a core pillar of modern IT operations and DevOps practices. At their foundation, these tools help organizations define, enforce, and maintain consistent…

Read More