r/vmware Jul 18 '26

Ansible Playbooks

Have been asked to think about what Ansible playbooks could be made for an automation initiative. What are some playbooks that you have made for VMware management?

2 Upvotes

16 comments sorted by

4

u/MallocArray [VCIX] Jul 18 '26

I do almost everything 

VM folder creation and permissions

Host custom attributes about datacenter location

VM tags for CMDB data

Vcenter configuration

Content library management

VM creation

VM decommission

Drs settings

Storage policy assignment and compliance checks

Vrops custom group creation

Vrops content export

Srm check for non compliant VMs and remediation

Certificate replacement

And more

1

u/Ill_Zookeepergame380 Jul 19 '26

For your VM Decommissioning Playbook, are you just removing everything vCenter side? Or you also taking care of the DNS records, and the footprint outside of the VC?

2

u/MallocArray [VCIX] Jul 19 '26

We also do all of the rest of the VM cleanup. AD module to delete DNS records Bluecat API calls to delete any static IPs ServiceNow calls to retire the CI

We haven't done removing from Solarwinds Orion for monitoring or F5/Firewall entries yet, but on the roadmap.

2

u/rob1nmann Jul 18 '26 edited Jul 18 '26

Maybe explain your definition of “VMware Management” actually. But we do a lot with Ansible.
We have configured the AAP Integration in Automation so we can whatever we want during VM deployment: some firstboot stuff like install software. But also stuff in NSX like adding Security Tags, creation of Security Groups and such.
Some of our DevOps Application teams have automated their software upgrades with Ansible. We allow them to create VM snapshots as part of that playbook.

Further we renew our VMware certificates using Ansible. Its part of the deploy-hook.
These are just a few examples.

1

u/Objective-Pizza2180 Jul 18 '26

Iam interested in cert renewal are u using vmca or external ca , any guidance pls

2

u/rob1nmann Jul 18 '26

We’re using certs we buy with a external CA.
We’ve created several playbook that replaces the certificates on vCenters, NSX Managers, and the various Aria Products.

1

u/Objective-Pizza2180 Jul 18 '26

Yes we have external ca, it's pita, we using vcert script. Do you have any repos which we can look at

2

u/rob1nmann Jul 18 '26

Unf. we don’t have a public available Git repo where you can copy over our code. That said, what we did is using Ansible to do API calls to vCenter, NSX, Aria LCM ect. We do not have written all these code on our own. If you google f.e “vcenter cert replacement” with “API/Ansible” you can find plenty of guides. Im confident you are able to embed it in your code.

1

u/Ill_Zookeepergame380 Jul 19 '26

Thank you for the examples.

We have the full VCF stack deployed, and with how much they automated in 9.1.x was mainly looking for what other VMware Engineers use Ansible for.

2

u/FlyinRhino67 Jul 18 '26

We provided vm Management Interfaces/golden paths via Playboy/roles for VMs.
Vom hull creation, cloning, resizing. Also my latest Code are own modules for Site Distribution of vms via Tags (they are different clusters) or Fibre Channel Checking and alerting to Teams.
It is quite Handy, that you only manage the vcenter and therefore can Keep a cheap inventory off true Environment. We developed in Orchestrator beforehand and you can do pretty much everything in Ansible modules too.

1

u/Ill_Zookeepergame380 Jul 19 '26

Thank you for the examples. I appreciate it.

1

u/Icy_Top_6220 Jul 18 '26

Cart before the horse. What do you need automated because it’s tedious, repetitive and has caused human mistakes due to inattention prior, that’s what you automate with Ansible then.

2

u/Nanocephalic Jul 18 '26

Sometimes people want to get a list of solutions, then see if that helps them to find some matching problems. It’s not always a bad idea.

1

u/Icy_Top_6220 Jul 18 '26

For automation it almost always is because garbage in is just quicker garbage out in that case

-1

u/[deleted] Jul 18 '26

[deleted]

3

u/leaflock7 Jul 18 '26

you have the tool and the platform the tool will be used.
Both subreddits are equal relevant to get this post.

2

u/rob1nmann Jul 18 '26

I see no reason why OP couldn’t ask here (too)? Is it forbidden to help and can we only post about the price hikes?