See: https://github.com/Terraform-VMWare-Modules/terraform-vsphere-vm
Use Terraform to provision VMs in vsphere and call ansible to configure hosts. The second half of this project (deploying a k3s cluster via gitops) is here
Once customization is complete:
terraform init
terraform plan
terraform apply # -auto-approve
In OPNsense, set Unbound DNS overrides to IP address and node name of terraform'd nodes
Note: Terraform expects it will be used to manage all infrastructure changes. To update currently 'managed' deployment, update
main.tf
.
# 'plan' will warn if the change will require destroying/reprovisioning a replacement host
terraform plan
terraform apply # -auto-approve
To tear down terraform-managed infra, run:
terraform destroy # -auto-approve