| Date | Release | Note |
|---|---|---|
| 2024-08-08 | 1.0 | First release |
| 2024-10-22 | 1.1 | Add VM and Packer |
- DNS Server and a lab zone
- A vCenter Server
- ESXi host (at least one)
- HashiCorp Cloud Platform account https://portal.cloud.hashicorp.com/
- Terraform Cloud account https://app.terraform.io
19/10/2024: HashCorp Platform - Valt secret added the ability to sync passwords with Terraform Workspace using Terraform access token. In this way, Vault secrets are handled as Terraform variables.
- DNS: In the lab zone set 2 records A
- vCenter Server host
- ESXi host
- HashiCorp Platform -> IAM: Service principals: user able to read secrets... under "Keys" generate client_id and secret_id
- HashiCorp Platform -> Vault Secret: Create the new app with the following secrets:
- esxi_default_username
- esxi_default_password
- Terraform Cloud: create an organization and a workspace
- Terraform Cloud -> Workspace (name): create the following variables:
- HCP_CLIENT_ID (as terraform variable - sensitive)
- HCP_CLIENT_SECRET (as terraform variable - sensitive)
- VC_HOST (as terraform variable - sensitive)
- VC_USER (as terraform variable - sensitive)
- VC_PASS (as terraform variable - sensitive)
- VC_esxi_hosts (as terraform variable - HCL) with a list like
["esxi1.yourlab.local","esxi2.yourlab.local"]
- Install a VM or use your PC for Terraform Agent (requires Docker) and check if it is running
- Generate Terraform Cloud -> API Token -> Generate a token able to plan and apply (user API token)
- Pull repo and move to datacenter folder
- Using terraform CLI issue
terraform loginand intert Terraform token - In terraform.tf change the organization name with yours
organization = "your-org-name" - In terraform.tf change the workspace name with yours
name = "your-workspace-name" - change the net_main_device in
variable_vsphere.tfaccording to your host (vmincN or vusbN) NOTE: the device must not belong to any vSwitch - terraform init
- terraform plan + apply