diff --git a/environments/skeleton/{{cookiecutter.environment}}/terraform/compute.tf b/environments/skeleton/{{cookiecutter.environment}}/terraform/compute.tf index 14c728a5a..d52c3c42c 100644 --- a/environments/skeleton/{{cookiecutter.environment}}/terraform/compute.tf +++ b/environments/skeleton/{{cookiecutter.environment}}/terraform/compute.tf @@ -18,4 +18,6 @@ module "compute" { k3s_token = var.k3s_token control_address = [for n in openstack_compute_instance_v2.control["control"].network: n.fixed_ip_v4 if n.access_network][0] security_group_ids = [for o in data.openstack_networking_secgroup_v2.nonlogin: o.id] + + compute_init_enable = var.compute_init_enable } diff --git a/environments/skeleton/{{cookiecutter.environment}}/terraform/compute/nodes.tf b/environments/skeleton/{{cookiecutter.environment}}/terraform/compute/nodes.tf index 7a2a706a6..ac34a443c 100644 --- a/environments/skeleton/{{cookiecutter.environment}}/terraform/compute/nodes.tf +++ b/environments/skeleton/{{cookiecutter.environment}}/terraform/compute/nodes.tf @@ -45,9 +45,16 @@ resource "openstack_compute_instance_v2" "compute" { } metadata = { - environment_root = var.environment_root - k3s_token = var.k3s_token - control_address = var.control_address + environment_root = var.environment_root + k3s_token = var.k3s_token + control_address = var.control_address + enable_compute = contains(var.compute_init_enable, "compute") + enable_resolv_conf = contains(var.compute_init_enable, "resolv_conf") + enable_etc_hosts = contains(var.compute_init_enable, "etc_hosts") + enable_nfs = contains(var.compute_init_enable, "nfs") + enable_manila = contains(var.compute_init_enable, "manila") + enable_basic_users = contains(var.compute_init_enable, "basic_users") + enable_eessi = contains(var.compute_init_enable, "eessi") } user_data = <<-EOF diff --git a/environments/skeleton/{{cookiecutter.environment}}/terraform/compute/variables.tf b/environments/skeleton/{{cookiecutter.environment}}/terraform/compute/variables.tf index 3655c9e65..a0e90c61b 100644 --- a/environments/skeleton/{{cookiecutter.environment}}/terraform/compute/variables.tf +++ b/environments/skeleton/{{cookiecutter.environment}}/terraform/compute/variables.tf @@ -76,3 +76,9 @@ variable "control_address" { description = "Name/address of control node" type = string } + +variable "compute_init_enable" { + type = list(string) + description = "Groups to activate for ansible-init compute rebuilds" + default = [] +} \ No newline at end of file diff --git a/environments/skeleton/{{cookiecutter.environment}}/terraform/variables.tf b/environments/skeleton/{{cookiecutter.environment}}/terraform/variables.tf index 0f5eefa18..19027dd19 100644 --- a/environments/skeleton/{{cookiecutter.environment}}/terraform/variables.tf +++ b/environments/skeleton/{{cookiecutter.environment}}/terraform/variables.tf @@ -52,6 +52,7 @@ variable "compute" { image_id: Overrides variable cluster_image_id vnic_type: Overrides variable vnic_type vnic_profile: Overrides variable vnic_profile + compute_init_enable: Toggles ansible-init rebuild EOF } @@ -136,3 +137,9 @@ variable "k3s_token" { description = "K3s cluster authentication token, set automatically by Ansible" type = string } + +variable "compute_init_enable" { + type = list(string) + description = "Groups to activate for ansible-init compute rebuilds" + default = [] +} \ No newline at end of file