ℹ️
This module is part of a larger project on setting up Game of Active Directory (GOAD) on Proxmox alongside our existing lab infrastructure. Click here to be taken back to the project landing page.
Previous Step
Objectives for this Step
- Configure the Terraform variables, recipe, and plan
- Create the lab environment with Terraform
Terraform the Lab
Variables
cd /root/GOAD/ad/GOAD/providers/proxmox/terraform
cp variables.tf.template variables.tf
nano variables.tf
variables.tf (click to expand)
variable "pm_api_url" {
default = "https://172.16.1.14:8006/api2/json"
}
variable "pm_user" {
default = "root@pam"
}
variable "pm_password" {
default = "ENTER_YOUR_ROOT_USER_PASSWORD"
}
variable "pm_node" {
default = "proxmox-um690"
}
variable "pm_pool" {
default = "GOAD"
}
variable "pm_full_clone" {
default = false
}
# change this value with the id of your templates (win10 can be ignored if not used)
variable "vm_template_id" {
type = map(number)
# set the ids according to your templates
default = {
"WinServer2019_x64" = 0
"WinServer2016_x64" = 0
# "Windows10_22h2_x64" = 0
}
}
variable "storage" {
# change this with the name of the storage you use
default = "local-lvm"
}
variable "network_bridge" {
default = "vmbr1"
}
variable "network_model" {
default = "e1000"
}
variable "network_vlan" {
default = 10
}
## the following variable is only for telmate provider (not used)
## change this value with the name of your templates (win10 can be ignored if not used)
# variable "vm_template_name" {$
# type = map(string)
#
# default = {
# "WinServer2019_x64" = "WinServer2019x64-cloudinit-qcow2"
# "WinServer2016_x64" = "WinServer2016x64-cloudinit-qcow2"
# "Windows10_22h2_x64" = "Windows10x64-22h2-cloudinit-qcow2"
# }
# }
❗Changes Made to the Document
Create and Run the Plan
cd /root/GOAD/ad/GOAD/providers/proxmox/terraform
terraform init
terraform plan -out goad.plan
terraform apply "goad.plan"
ℹ️
As noted by the author, if you get any errors during the
The whole idea with Infrastructure as Code is "idempotency". So, if you run a plan once or ten times, the result should always be the same, and only apply what needs applying.
terraform apply
operation, just run terraform apply "goad.plan"
again.The whole idea with Infrastructure as Code is "idempotency". So, if you run a plan once or ten times, the result should always be the same, and only apply what needs applying.