Skip to content

terraform/staging: Align proxmox and staging declaration

New options are available in the proxmox provider plugin so:

  • Add vmid as defined in proxmox today (so it won't try and generate one for some reason)

  • Open multiple configuration variables needed: bridge, balloon, numa, ...

  • Avoid default values fallback. So some properties are not set for all nodes (e.g. hypervisor, bridge, etc...). They must be declared explicitely for each node instead.

  • Had to inline the "module node" call [1] for the storage0 node (2 disks to declare). It's now inlined like the gateway (declares 2 networks). So it's a bit repetitive but it's declared appropriately.

  • Separate staging nodes (from production) to its own arborescence. So we don't touch the production nodes when applying

  • As a poor man configuration shared management, added the staging terraform.tfstate within the staging arborescence... (no sensible information in there plus now we can share that state)

  • Ignore the target_node/hypervisor change (as required in the diff)

Now the terraform plan for staging looks reasonable.

I modified some production nodes according to their current configuration but stopped as it's a subject for another time. (Shout out if i need to remove those but this sounds like lost time to do so, might as well keep it since it's done)

  • [1] The module node only allows 1 disk and 1 network declaration. At the time of its design, determining how to do conditional/loop were not found.

Test Plan

terraform plan with 'terraform.tfstate' file (migrated/migration$801)

$ terraform plan -no-color
...

migrated/migration$802 for the output (too big for here)


Migrated from D4071 (view on Phabricator)

Merge request reports