From ad2c8145e3dd0c9a5891e5115955f70ee1480dee Mon Sep 17 00:00:00 2001 From: Guy Godfroy Date: Sun, 15 Mar 2026 14:09:20 +0100 Subject: [PATCH] Remove redundant incus_ prefix from root module variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rename variables to remove the useless incus_ prefix: - incus_hypervisors → hypervisors - incus_witnesses → witnesses - incus_token → token - incus_networks → networks - incus_storage_pools → storage_pools Updates all references across provider.tf, groups.tf, network.tf, storage.tf, and .auto.tfvars files. Co-Authored-By: Claude Haiku 4.5 --- incus/groups.tf | 4 ++-- incus/members.auto.tfvars | 6 +++--- incus/network.auto.tfvars | 2 +- incus/network.tf | 6 +++--- incus/provider.tf | 6 +++--- incus/storage.auto.tfvars | 2 +- incus/storage.tf | 6 +++--- incus/variables.tf | 10 +++++----- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/incus/groups.tf b/incus/groups.tf index ee6dc90..a2cdf70 100644 --- a/incus/groups.tf +++ b/incus/groups.tf @@ -4,7 +4,7 @@ resource "incus_cluster_group" "default" { } resource "incus_cluster_group_member" "hypervisor" { - for_each = var.incus_hypervisors + for_each = var.hypervisors cluster_group = incus_cluster_group.default.name member = each.key } @@ -15,7 +15,7 @@ resource "incus_cluster_group" "witness" { } resource "incus_cluster_group_member" "witness" { - for_each = var.incus_witnesses + for_each = var.witnesses cluster_group = incus_cluster_group.witness.name member = each.key } diff --git a/incus/members.auto.tfvars b/incus/members.auto.tfvars index 202c182..e4f4727 100644 --- a/incus/members.auto.tfvars +++ b/incus/members.auto.tfvars @@ -1,10 +1,10 @@ -incus_hypervisors = { +hypervisors = { "hv-01" = "https://192.168.0.11:8443" "hv-02" = "https://192.168.0.12:8443" } -incus_witnesses = { +witnesses = { "nuc" = "https://192.168.0.10:8443" } -incus_token = "eyJjbGllbnRfbmFtZSI6InRmIiwiZmluZ2VycHJpbnQiOiIxYjNmZGJmNTNlZTdlODc4NDllY2RiNTkyYzNkYTRkYmE0M2I3Mjg1OTFlYTAxYmE1NTNkZGRmYzJjNTBjNWMzIiwiYWRkcmVzc2VzIjpbIjE5Mi4xNjguMC4xMTo4NDQzIl0sInNlY3JldCI6IjAzNzFmMTdjMDc1OGU2ZmU5ZGJjNTkwZmNhYTAzOTllYWJkMDY3N2E4ODIzMGY1ZjkyYzdlNjNlYmMyYmU0NDQiLCJleHBpcmVzX2F0IjoiMDAwMS0wMS0wMVQwMDowMDowMFoifQ==" +token ="eyJjbGllbnRfbmFtZSI6InRmIiwiZmluZ2VycHJpbnQiOiIxYjNmZGJmNTNlZTdlODc4NDllY2RiNTkyYzNkYTRkYmE0M2I3Mjg1OTFlYTAxYmE1NTNkZGRmYzJjNTBjNWMzIiwiYWRkcmVzc2VzIjpbIjE5Mi4xNjguMC4xMTo4NDQzIl0sInNlY3JldCI6IjAzNzFmMTdjMDc1OGU2ZmU5ZGJjNTkwZmNhYTAzOTllYWJkMDY3N2E4ODIzMGY1ZjkyYzdlNjNlYmMyYmU0NDQiLCJleHBpcmVzX2F0IjoiMDAwMS0wMS0wMVQwMDowMDowMFoifQ==" diff --git a/incus/network.auto.tfvars b/incus/network.auto.tfvars index 55df2f7..0efec52 100644 --- a/incus/network.auto.tfvars +++ b/incus/network.auto.tfvars @@ -1,4 +1,4 @@ -incus_networks = { +networks = { "main" = { type = "physical" hypervisor_config = { diff --git a/incus/network.tf b/incus/network.tf index b9bde5e..90b0884 100644 --- a/incus/network.tf +++ b/incus/network.tf @@ -1,10 +1,10 @@ module "network" { source = "./modules/network" - for_each = var.incus_networks + for_each = var.networks name = each.key type = each.value.type - hypervisors = toset(keys(var.incus_hypervisors)) - witnesses = toset(keys(var.incus_witnesses)) + hypervisors = toset(keys(var.hypervisors)) + witnesses = toset(keys(var.witnesses)) hypervisor_config = each.value.hypervisor_config witness_config = each.value.witness_config } diff --git a/incus/provider.tf b/incus/provider.tf index 4f9eea7..39746f1 100644 --- a/incus/provider.tf +++ b/incus/provider.tf @@ -9,14 +9,14 @@ terraform { provider "incus" { generate_client_certificates = true accept_remote_certificate = true - default_remote = keys(var.incus_hypervisors)[0] + default_remote = keys(var.hypervisors)[0] dynamic "remote" { - for_each = var.incus_hypervisors + for_each = var.hypervisors content { name = remote.key address = remote.value - token = var.incus_token + token = var.token } } } diff --git a/incus/storage.auto.tfvars b/incus/storage.auto.tfvars index f0a9b82..14d64b3 100644 --- a/incus/storage.auto.tfvars +++ b/incus/storage.auto.tfvars @@ -1,4 +1,4 @@ -incus_storage_pools = { +storage_pools = { "san" = { driver = "lvmcluster" hypervisor_config = { "lvm.vg_name" = "nucVG" } diff --git a/incus/storage.tf b/incus/storage.tf index e14b04e..0837bae 100644 --- a/incus/storage.tf +++ b/incus/storage.tf @@ -1,10 +1,10 @@ module "storage" { source = "./modules/storage" - for_each = var.incus_storage_pools + for_each = var.storage_pools name = each.key driver = each.value.driver - hypervisors = toset(keys(var.incus_hypervisors)) - witnesses = toset(keys(var.incus_witnesses)) + hypervisors = toset(keys(var.hypervisors)) + witnesses = toset(keys(var.witnesses)) hypervisor_config = each.value.hypervisor_config witness_config = each.value.witness_config } diff --git a/incus/variables.tf b/incus/variables.tf index eb18cc1..223275f 100644 --- a/incus/variables.tf +++ b/incus/variables.tf @@ -1,18 +1,18 @@ -variable "incus_hypervisors" { +variable "hypervisors" { type = map(string) } -variable "incus_witnesses" { +variable "witnesses" { type = map(string) } -variable "incus_token" { +variable "token" { type = string sensitive = true description = "The common authentication token for all Incus remotes" } -variable "incus_networks" { +variable "networks" { type = map(object({ type = string hypervisor_config = map(string) @@ -20,7 +20,7 @@ variable "incus_networks" { })) } -variable "incus_storage_pools" { +variable "storage_pools" { type = map(object({ driver = string hypervisor_config = map(string)