Reader small image

You're reading from  Ansible for Real-Life Automation

Product typeBook
Published inSep 2022
PublisherPackt
ISBN-139781803235417
Edition1st Edition
Concepts
Right arrow
Author (1)
Gineesh Madapparambath
Gineesh Madapparambath
author image
Gineesh Madapparambath

Gineesh Madapparambath has over 15 years of experience in IT service management and consultancy with experience in planning, deploying, and supporting Linux-based projects. He has designed, developed, and deployed automation solutions based on Ansible and Ansible Automation Platform (formerly Ansible Tower) for bare metal and virtual server building, patching, container management, network operations, and custom monitoring. Gineesh has coordinated, designed, and deployed servers in data centers globally and has cross-cultural experience in classic, private cloud (OpenStack and VM ware), and public cloud environments (AWS, Azure, and Google Cloud Platform). Gineesh has handled multiple roles such as systems engineer, automation specialist, infrastructure designer, and content author. His primary focus is on IT and application automation using Ansible, containerization using OpenShift (and Kubernetes), and infrastructure automation using Terraform.
Read more about Gineesh Madapparambath

Right arrow

Expanding Your Automation Landscape

It is important to find and apply automation at the right place and at the right level. Usually, when searching for automation use cases, people make mistakes by automating the inappropriate tasks and end up wasting money, effort, and time. This is the reason why we need to analyze the environment and day-to-day tasks and find the best tasks as automation candidates. We can use your statistical data such as event tickets, customer change requests, and project tasks to find this information.

In this chapter, you will learn about the following topics:

  • Finding your automation use cases in your day-to-day work
  • Automation feasibility and usability
  • Involving teams in the automation journey
  • The Ansible dynamic inventory

We will start with standard methods to analyze the tasks to find the highest number of tasks and check the feasibility of automation. We will explore the integration opportunities between IT service management...

Technical requirements

The following are the technical requirements to proceed with this chapter:

  • A Linux machine as an Ansible control node (with internet access)
  • One or more Linux machines as managed nodes with Red Hat repositories configured (if you are using non-RHEL machines, then make sure you have appropriate repositories configured to get packages and updates)
  • Basic knowledge of the AWS platform and an AWS account with one or more test machines created

All the Ansible artifacts, playbooks, commands, and snippets for this chapter can be found in the GitHub repository at https://github.com/PacktPublishing/Ansible-for-Real-life-Automation/tree/main/Chapter-05.

Finding your automation use cases in your day-to-day work

We all know that every member of staff working in an IT environment is executing some tasks and most of the time, they repeat the same job every day. Looking around, we can see many examples, as follows:

  • A system engineer is building servers and virtual machines, installing packages, patching old systems, and more.
  • A network engineer is configuring the new network device and firewall devices, configuring ports and virtual local area networks (VLANs) based on requests, patching the device firmware, and many other things.
  • A developer is struggling to build his coding environment every time there is a new version of the programming language or software library. They are also spending a lot of time testing the code and waiting for test results.
  • A storage administrator is spending their valuable time provisioning the disk space and configuring the storage devices.
  • A database administrator is complaining about...

Automation feasibility and usability

We all need to understand that not all use cases or repeated jobs are suitable for automation. We need to study and confirm the feasibility of implementing the use case using Ansible automation.

Once you find the use cases, you can ask yourself several questions to understand the feasibility of implementation and usability of your automation use cases.

How complex is the use case?

You need to Consider the complexity of the use case or workflow you are trying to automate. If the use case is too complex, then you can split it into smaller use cases. You need to start with smaller use cases to avoid any possible delay or obstruction.

For example, if you want to automate the Linux operating system (OS) patching task, then split the job into multiple use cases as follows:

  1. Take a virtual machine snapshot.
  2. Back up the configuration.
  3. OS patching tasks.
  4. Verification of the OS after patching and reboot.
  5. Restore snapshot...

Involving teams in the automation journey

It is a common misunderstanding that the responsibility for finding use cases and implementing automation only falls to the systems team, platforms team, or infrastructure team. When we explore our work environment and day-to-day tasks, we will find thousands of tasks that we can automate using Ansible. It could be the database team managing database servers and instances, the network team handling network operations, or the application team who wants to deploy their application updates more effectively. Implementing automation in the environment is a collaborative journey, and we need support and guidance from different teams.

For example, typical database provisioning steps can be seen in Figure 5.5:

Figure 5.5 – Typical database provisioning tasks

Many of the tasks listed in Figure 5.5 can be automated using Ansible, and the workflow can be completed in minutes instead of days and weeks. The database team...

Ansible dynamic inventory

It is easy to manage your managed node information inside static inventory files when you have a smaller number of nodes or an almost fixed set of assets, such as bare-metal servers or virtual machines that are not frequently recreated. But, if your environment contains many dynamic nodes, such as virtual machines on multiple public or private cloud platforms, Kubernetes, or OpenShift platforms, then keeping your managed node information inside static files will be difficult, as you need to keep track of the changes and update your inventory files with them, including IP addresses, login credentials, and more. In such cases, you can use the dynamic inventory features in Ansible, which are basically some custom scripts and inventory plugins that collect inventory information from these virtualization or container platforms.

When you pass the dynamic inventories to Ansible, the inventory plugins will be executed and will collect the details of managed nodes...

Summary

In this chapter, you have learned methods to find automation use cases in your workplace and determine the feasibility and usability of these automation use cases. You have also explored the importance of collaboration between teams to implement better automation use cases. Later in the chapter, you learned how to use the Ansible dynamic inventory and practiced using the Ansible inventory plugin with the AWS ec2 inventory plugin.

In the next chapter, we will learn the basics of Windows automation and the remote connection methods available. We will also learn the basics of network automation using Ansible with practice sections.

Further reading

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Ansible for Real-Life Automation
Published in: Sep 2022Publisher: PacktISBN-13: 9781803235417
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Author (1)

author image
Gineesh Madapparambath

Gineesh Madapparambath has over 15 years of experience in IT service management and consultancy with experience in planning, deploying, and supporting Linux-based projects. He has designed, developed, and deployed automation solutions based on Ansible and Ansible Automation Platform (formerly Ansible Tower) for bare metal and virtual server building, patching, container management, network operations, and custom monitoring. Gineesh has coordinated, designed, and deployed servers in data centers globally and has cross-cultural experience in classic, private cloud (OpenStack and VM ware), and public cloud environments (AWS, Azure, and Google Cloud Platform). Gineesh has handled multiple roles such as systems engineer, automation specialist, infrastructure designer, and content author. His primary focus is on IT and application automation using Ansible, containerization using OpenShift (and Kubernetes), and infrastructure automation using Terraform.
Read more about Gineesh Madapparambath