How ansible helps in solving challenges faced by big industries?

Gulsha Chawla
6 min readAug 24, 2021

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

History of Ansible

📍The term “ansible” was coined by Ursula K. Le Guin in her 1966 novel Rocannon’s World and refers to fictional instantaneous communication systems.

📍The Ansible tool was developed by Michael DeHaan, the author of the provisioning server application Cobbler and co-author of the Fedora Unified Network Controller (Func) framework for remote administration.

📍Ansible, Inc. (originally AnsibleWorks, Inc.) was the company set up to commercially support and sponsor Ansible. Red Hat acquired Ansible in October 2015.

How does Ansible work?

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

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

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

What does Ansible do?

📍The term Ansible modules sounds complex, but most of the complexity is handled by Ansible and not the user.

📍An Ansible module is written to be a model of the desired state of a system, meaning that each module defines what should be true on any given managed node.

Ansible playbooks

📍While modules provide the means of accomplishing a task, the way you use them is through an Ansible playbook. A playbook is a configuration file written in YAML that provides instructions for what needs to be done to bring a managed node into the desired state.

📍Playbooks are meant to be simple, human-readable, and self-documenting. They are also idempotent, meaning that a playbook can be run on a system at any time without harming it. If a playbook is run on a system that’s already properly configured and in its desired state, then that system should still be properly configured after a playbook runs.

📍Playbooks can also be very complex, with conditionals and variables. However, because most of the real work is done by Ansible modules, playbooks remain brief, readable, and clear even though they can orchestrate entire networks of managed nodes.

Modules

📍Modules are mostly stand-alone and can be written in a standard scripting language (such as Python, Perl, Ruby, Bash, etc.).

📍One of the guiding properties of modules is idempotency, which means that even if an operation is repeated multiple times (e.g., upon recovery from an outage), it will always place the system into the same state.

Inventory configuration

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

Cloud integration

Ansible can deploy to bare-metal hosts, virtualized systems, and cloud environments, including Amazon Web Services, Atomic, Lumen, Cloudscale, CloudStack, DigitalOcean, Dimension Data, Docker, Google Cloud Platform, KVM, Linode, LXC, LXD, Microsoft Azure, OpenStack, Oracle Cloud, OVH, oVirt, Packet, Profitbricks, PubNub, Rackspace, Scaleway, SmartOS, SoftLayer, Univention, VMware, Webfaction, and XenServer.

INTEGRATION:

Ansible AND Windows

ANSIBLE: LINUX LIKE LINUX, WINDOWS LIKE WINDOWS.

📍Users and customers love Ansible’s simple, agentless(serverless), powerful automation that allows them to model and deliver any configuration, and deployment, any environment across their IT infrastructure.

📍Ansible knew that the key was to bring the same simple, agentless paradigm to managing Windows, while still feeling native to Windows administrators. Ansible’s native Windows support uses Windows PowerShell remoting to manage Windows like Windows in the same Ansible agentless way that Ansible manages Linux like Linux.

With Ansible’s native Windows support, you can, out of the box:

✍🏻Gather facts on Windows hosts

✍🏻Install and uninstall MSIs

✍🏻Enable and disable Windows Features

✍🏻Start, stop and manage Windows services

✍🏻Create and manage local users and groups

✍🏻Manage Windows packages via the Chocolatey package manager.

✍🏻Manage and install Windows updates

✍🏻Fetch files from remote sites

✍🏻Push and execute any PowerShell scripts you write

📍You can connect to and automate Windows using local or domain users, and soon you’ll be able to use Windows ‘run as’ support to execute actions as the Administrator, just as you would use ‘sudo’ or ‘su’ on Linux.

📍Plus, with Ansible’s easy extensibility, you can write your own modules in PowerShell and extend Ansible for whatever other functionality you need. Ansible users have written modules for managing filesystem ACLs, managing Windows Firewall, and managing hostname and domain membership, and more.

Using the win_dsc Module in Ansible💡

What is DSC?

📍So what exactly is Desired State Configuration? 🤔.It’s basically a system configuration management platform that uses the declarative model; in other words, you tell DSC the “what”, and it will figure out the “how”. Much like Ansible, DSC uses push-mode execution to send configurations to the target hosts. This is very important to consider when delivering resources to multiple targets.

📍This time-saving tool is built into PowerShell, defining Windows node setup through code. It uses the Local Configuration Manager (which is the DSC execution engine that runs on each node).

How Do You Use DSC with Ansible?

📍DSC Resources are distributed as PowerShell modules, which means that it works similarly to Ansible, just implemented differently. The win_dsc module has been available since the release of Ansible 2.4, and it can influence existing DSC resources whenever it interacts with a Windows host.

📍To use this module, you will need PowerShell 5.1 or later. Once you make sure that you have the correct version of PowerShell installed on your Windows nodes, using DSC is as easy as executing a task using the win_dsc module.

Conclusion

✨Ansible is powerful automation that allows them to model and deliver any configuration, any deployment, any environment across their IT infrastructure.

✨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 solves problems once and shares the results with everyone.

✨Ansible breaks down silos, creates a culture of automation.

✨Ansible automates the technologies you already use.

Thank you for reading my article😃

Keep Learning💯 Keep Sharing😇

Good day : )

--

--