This role allows the removal of a virtual machine and redeployment of a virtul machine template within vCenter. Information about the guest is gathered from IPAM, like the OS, memory and vcpu information. To change the operating system, simply update the virtual machine inside Netbox and run the playbook.
This playbook is used in my homelab. It's not perfect and can definitely be improved. Don't expect this playbook to work for you out the box as our environments will differ.
- vCenter appliance
- vCenter templates
- Netbox IPAM
- vault_ipam_url: The URL of your IPAM
- vcenter_hostname: The hostname of your venter appliance
- vcenter_user: Your vCenter username
- vcenter_pass: Your vCenter password
- vmnetwork: The VM network within venter
- vmtemplate: The template you'd like to deploy
- vmnetmask: The VMs netmask
- vmgateway: The VMs gateway
None.
- hosts: all
become: true
roles:
- redeploy-vm
GNUv3
This role was created by Dan Hand.