Ansible Automation

Ansible Automation

So, the beginning of the year has been quite busy for me. I have written some automations for our environment to make our day-to-day operations more efficient. So I thought that I should share what I have been working on. It's mainly two workflows

  • Automated Template patching
  • Automated Executive Capacity Reports

Follow along in this blog post series.

For those who have missed my blog post series about how we set up our DEVOPS environment for our environments, you can find that series here:

Building a DevOps Environment on Nutanix, Ansible, Kubernetes, and Rancher in Action
A while ago, we started using Ansible to perform VM lifecycle operations on the Nutanix platform. Now that I finally have the time, I thought it would be a good idea to write a blog post series about how we set up the Ansible environment on our test cluster and

Overview of Patching Automation

This is the general flow of the patching of templates:

  • Two separate Ansible playbooks depending on platform (Nutanix or VMware)
  • Two separate Ansible playbooks per platform depending on operating system family (Windows or Linux)
  • Separate AWX jobs depending on operating system (Win2022, Win2025, Ubuntu, or Rocky)

General workflow:

Start Template -> Configure Template to boot in staging network -> Install all updates -> Sysprep / Cloud-init to prepare for cloning.

My playbooks are named like this:

  • patch_linux_template_ntnx.yml
  • patch_linux_template_vmw.yml
  • patch_win_template_ntnx.yml
  • patch_win_template_vmw.yml

Windows Workflow

To read about the Windows Workflow. Take a look at this post:

Autopatching Windows Templates with ansible
The first thing I have been working on is the autopatching of our golden images that we use for our workflows where we create new virtual machines. So I thought that I should go through that process now in detail. In this post, we will cover the Nutanix Windows Workflow

Linux Workflow

To read about the Linux Autopatching Workflow, take a look at this post:

Autopatching Linux Templates
If you missed the first post in my series around Windows Template patching, you can find it here: Autopatching Windows Templates with ansibleThe first thing I have been working on is the autopatching of our golden images that we use for our workflows where we create new virtual machines. So

The AWX workflow

In this post you can read about how i scheduled those jobs in AWX.

AWX Schedules for Autopatching playbooks
So, if you have read my previous posts on autopatching for Windows and Linux templates in our environments: Windows Post: Autopatching Windows Templates with ansibleThe first thing I have been working on is the autopatching of our golden images that we use for our workflows where we create new virtual

Overview of Automated Capacity Reports

We are in the process of changing a lot in our infrastructure and we have capacity planning meetings. Since we do not have access to the Nutanix Cluster Runway capacity planning, and since we also have a VMware environment, I wrote those two playbooks to extract some capacity information from our clusters for our executives to read and use.

No need for me to prepare the reports for them manually—a win-win.

Automated Executive Capacity Reports

To read about the Executive Capacity Reports for Nutanix, read this post:

Automated Capacity report from PrismCentral
I have been thinking about this for a long time. Can I automate capacity reports for my executives so they can trigger a capacity report on demand? At the end of last week, I thought it was time to automate this. Here are the details. The whole playbook is written

To read about the Executive Capacity Reports for VMware, read this post:

Comming soon...


Automation is so nice since we can save a lot of time. Hope that you have gotten some inspiration from this blog post series.