DevOps 5: Summary and inspiration

So, we have now successfully deployed a Rancher Orchestration cluster on k3s, we have deployed our Rancher RKE2 downstream cluster on nutanix using the nutanix node driver for rancher, and then we have deployed two fantastic tools, both AWX and Ansible Forms, to start automating and orchestrating our Nutanix environment from a DevOps workflow.
Even if I could not go into every little detail in every post, I hope this helps someone out there. It will definitely help me when going back and looking at our work over the past months. 😄
Inspiration
So what can we now do with these three fantastic open-source tools? I can try to give you a bit of inspiration.
If we begin from the top up, we use Ansible Forms to build custom forms using different methods to deploy VMs in our environment.
For example, we use integrations with our CRM system to fetch customer data and collect it into an array, presenting it to the end user as a dropdown menu.

Then we can send those values as extravars into AWX when we run our Ansible playbooks.
This is, in short, what our Ansible Forms form does:
- Fetch customers from CRM and present them in a dropdown.
- Give the user a choice if they want to deploy a Windows or Linux VM.
- Set hostname.
- Set domain suffix on the VM.
- Configure vCPU and memory.
- Enable backup yes/no
- If yes, then we fetch the customer's backup jobs from our backup solution using APIs and then send extravars to add the new VM to the backup job.
- If yes, then we fetch the customer's backup jobs from our backup solution using APIs and then send extravars to add the new VM to the backup job.
- Fetch the Nutanix project for the specific customer using Prism Central APIs.
- Set an extravar for the owner of the VM.
- Fetch the VLANs assigned to the selected project chosen in step 7 and give the user the ability to select a VLAN from that list.
- Last but not least, we take the VLAN chosen in step 9 and interact with our IPAM system to fetch available IP addresses in the VLAN and present a dropdown to the user with available IPs.
All those different things we then send as extravars to our AWX deployment, and then it kicks off a lot of things in sequence based on the different selections the user made.
Basically, we have a three-step process that starts in AWX.
STEP 1: gather info
The first set of playbooks gathers info from different moving parts based on the extravars chosen in AnsibleForms. This is a simple flowchart of step 1 with some masked-out information. :)

STEP 2: Clone VM
In step two, we take all the information that we gathered from the extravars and step 1 and now go ahead and clone a template in the Nutanix environment.
Step 2 flowchart looks like this:

Once the VM is cloned, we change the owner and store the new VM's UUID for later use.
STEP 3: Custom Configuration
After we have created the VM, we configure different things based on the extravars that we made in Ansible Forms.
For example, if "enable_backup=yes," then we enable the backup.
Then we create the VM object in our CMDB system and write the information back to Nutanix so that we have the CMDB-ID attached to the VMs description.
The flowchart for step three looks something like this:

So that's all, folks. That will wrap up this blog post series on automation and using different open-source tools out there. :)
Have a nice summer!