Automation with Ansible — Introduction, and Applications
This is the first article in the Automation with Ansible series. In this series, we will be looking at different ways in which Ansible can be used to implement automation in the IT industry
Before starting to work with Ansible, we need to understand the hows and whys of using Ansible, and more importantly, the need for Automation in the IT industry.
Why do we need Automation?
Automation has become a very crucial part of our lives in different industries like IT, Manufacturing, etc. and each automation is implemented differently. Irrespective of the industry, automation is adopted for one major goal — to reduce the time spent on repetitive and easier tasks, and give more time to the skilled individuals to work on more complex issues. Automation also reduces the scoop of error involved in a process due to human involvement
In the case of the IT industry, one of the most common implementations of automation is the use of different tools that can be used to perform repetitive work like setting up multiple computer systems with the same kind of software configurations. As explained by RedHat,
In theory, if it’s an IT task, some level of automation can be applied to that task. So, automation can integrate with and apply to anything from network automation to infrastructure, cloud provisioning and standard operating environments (SOEs), and further, to application deployment and configuration management.
Automation capabilities and applications can extend further into specific technologies, like containers, to methodologies, like DevOps, and into broader areas, such as cloud, edge computing, security, testing, and monitoring/alerting.
What does Ansible mean for automation?
To put it simply, Ansible is an open-source tool with which we can configure, deploy, and orchestrate resources from many other technologies across different platforms. As stated by the creator of the tool, RedHat,
Ansible is a very simple tool built on the programming language Python that allows us to control multiple systems (called target/managed nodes) with a single node (called the controller node) with a very easy-to-understand framework. This means we can work with multiple systems simultaneously without the added burden of special security configurations or agents.
Ansible works by connecting with the managed nodes using SSH (by default) and uses programs called Ansible modules, which can be used to make the desired changes on one or more managed nodes. Ansible needs to be installed only on the controller node; there is no special setup required on any of the managed nodes, which makes working with Ansible even easier. We can work with ansible using commands on the terminal, or by using Ansible Playbooks, where we can describe our requirements using the YAML format using Ansible modules. Effectively, all we need to do to work with Ansible is to set up Ansible on the controller node and allow SSH traffic between the controller nodes and managed nodes. Very simple right?
Amongst the various technologies and methodologies, Ansible has grown to become an integral part of implementing automation with ease, due to a number of reasons. Some of these reasons have been discussed below:
We need to constantly improve the way our technologies are used in the industry and businesses. The current times also demand faster development and deployment of new products, which is possible if we allow machines to take over some of the easier tasks and allow humans to deal with more complex problems.
However, introducing machines also brings up its own set of issues, because each development and deployment cycle has highly customized requirements, and one set of tools used in a given cycle may not be used in others. Thus, it is very hard for the teams in the IT industry to keep learning about different technologies, based on each project’s requirements.
Ansible reduces the complexity of using multiple technologies by providing an engine that can interact with multiple tools across different kinds of Operating Systems. This means the user(s) of these tools do not need to necessarily remember the more obscure commands and other nitty-gritty details and can simply use the in-built ansible modules to set up, configure and work with those tools. This is even more significant when we need to use the same set of tools and configurations on multiple systems, as Ansible allows us to interact with multiple managed nodes at the same time.
2. Reduce Repetitiveness
The main motive of automation is to reduce the time spent on repetitive tasks and essentially speeding up the process of product development and deployment. Ansible achieves this motive through a simple automation engine and language that can interact with different tools, frameworks, and Operating Systems as a common platform. It reduces the complexity that automation brings in exchange for faster development and deployment, and reduction in errors due to human intervention.
3. Designed for teams
Automation tools often increase the overall complexity of a project, when teams use it for a single project. Ansible reduces this by providing a common interface through which we can interact with different tools using a simple English-like language.
4. Descriptive model of working
Ansible is built on Python and it uses a descriptive approach to complete its tasks instead of an imperative approach. This means we can avoid the complexities of describing the way in which our requirements should be satisfied (as is the case of imperative approach), and can simply focus on declaring our requirements. This also makes the overall code in the program file (Ansible Playbook) easier to understand and modify and maintain in the future.
All in all, Ansible provides a very easy-to-use and easily scalable format for single user or a team to comfortable work with multiple systems from a single computer.
Let’s look at how Ansible is used in the real world!
- NASA is using Ansible Towers to manage its AWS environment better and provide security. Now, they carry out updates on their official website within minutes, monitor RAM and HDs in near real-time, set up application stacks within minutes, and provision OS seamlessly in the background.
- Ruan Transportation is using Ansible to automate deployments using Playbooks and Ansible Towers. Using Ansible Tower’s RBAC, they are delegating the tasks defined in Playbooks early in the deployment cycle, to operations and business teams. They are now utilizing Ansible to streamline their implementation of DevOps and develop a manageable infrastructure.
- The BMW Group is meeting the challenges of handling large amounts of data collected from sensors, which will be used to develop its automated vehicle initiatives. They have partnered with RedHat, and used multiple products and services of RedHat like OpenShift, Ansible, RedHat Virtualization, RedHat Satellite and RedHat Consulting to develop the DXC technology, which has been awarded as one of the winners at the 14th RedHat Innovation Awards. The DXC technology is helping BMW build a big data-driven platform with high capabilities of IT automation. Due to the introduction of automation, repetitive tasks are now handled by software, which has in turn reduced development time and increased developer productivity.
- Intermountain Healthcare, based at Salt Lake City, Utah, USA, is automating and optimizing its IT infrastructure using solutions from RedHat, one of which is Ansible. It has drastically reduced deployment time, cut IT costs and improved collaboration between teams which are using DevOps.
Ansible is quickly turning out to be a one-stop solution for all our DevOps and automation needs as it serves as a single platform to interact with a number of other tools and different Operating Systems. Its easy-to-use language and descriptive approach also makes it very easy for even non-technical people to quickly learn and implement tasks with Ansible.
In the next article, we will look at some of the common terms and concepts used in Ansible.