Skip to content

proxmox/terraform: Avoid variables duplication

Sole pattern found to avoid duplication.

This defines once the variables (configuration) needed both in the main definition and in the module. When calling the module, we then pass along that configuration to the module call [1]

Depends on !35 (closed)

Test Plan

terraform init
terraform plan
terraform apply

output (Nothing has changed \m/)

$ terraform apply
proxmox_vm_qemu.gateway: Refreshing state... (ID: orsay/qemu/109)
proxmox_vm_qemu.node: Refreshing state... (ID: orsay/qemu/115)
proxmox_vm_qemu.node: Refreshing state... (ID: orsay/qemu/114)

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

Outputs:

db0_summary =
hostname: db0
fqdn: db0.internal.staging.swh.network
network: ip=192.168.128.3/24,gw=192.168.128.1 macaddr=3A:65:31:7C:24:17

storage0_summary =
hostname: storage0
fqdn: storage0.internal.staging.swh.network
network: ip=192.168.128.2/24,gw=192.168.128.1 macaddr=CA:73:7F:ED:F9:01

Migrated from D1809 (view on Phabricator)

Merge request reports