diff --git a/proxmox/terraform/modules/node/main.tf b/proxmox/terraform/modules/node/main.tf --- a/proxmox/terraform/modules/node/main.tf +++ b/proxmox/terraform/modules/node/main.tf @@ -83,8 +83,8 @@ [ # First install facts... "mkdir -p /etc/facter/facts.d", - "echo deployment=${var.facter_deployment} > /etc/facter/facts.d/deployment.txt", - "echo subnet=${var.facter_subnet} > /etc/facter/facts.d/subnet.txt", + "echo deployment=${var.config["facter_deployment"]} > /etc/facter/facts.d/deployment.txt", + "echo subnet=${var.config["facter_subnet"]} > /etc/facter/facts.d/subnet.txt", "sed -i 's/127.0.1.1/${lookup(var.networks[0], "ip")}/g' /etc/hosts", # so puppet agent installs the node's role "puppet agent --server ${var.config["puppet_master"]} --environment=${var.config["puppet_environment"]} --waitforcert 60 --test || echo 'Node provisionned!'", diff --git a/proxmox/terraform/modules/node/variables.tf b/proxmox/terraform/modules/node/variables.tf --- a/proxmox/terraform/modules/node/variables.tf +++ b/proxmox/terraform/modules/node/variables.tf @@ -3,18 +3,6 @@ type = string } -variable "facter_subnet" { - description = "Subnet custom fact (e.g sesi_rocquencourt_staging, ...)" - type = string - default = "sesi_rocquencourt_staging" -} - -variable "facter_deployment" { - description = "Deployment custom fact (e.g staging, production)" - type = string - default = "staging" -} - variable "description" { description = "Node's description" type = string diff --git a/proxmox/terraform/production/production.tf b/proxmox/terraform/production/production.tf --- a/proxmox/terraform/production/production.tf +++ b/proxmox/terraform/production/production.tf @@ -3,6 +3,8 @@ dns = var.dns domain = "internal.softwareheritage.org" puppet_environment = "production" + facter_deployment = "production" + facter_subnet = "sesi_rocquencourt" puppet_master = var.puppet_master gateway_ip = "192.168.100.1" user_admin = var.user_admin diff --git a/proxmox/terraform/staging/staging.tf b/proxmox/terraform/staging/staging.tf --- a/proxmox/terraform/staging/staging.tf +++ b/proxmox/terraform/staging/staging.tf @@ -10,6 +10,8 @@ dns = var.dns domain = var.domain puppet_environment = var.puppet_environment + facter_deployment = "staging" + facter_subnet = "sesi_rocquencourt_staging" puppet_master = var.puppet_master gateway_ip = var.gateway_ip user_admin = var.user_admin