From 06dd910cc0e5bd80bf401d485f3576f25c14aadb Mon Sep 17 00:00:00 2001 From: Will Szumski Date: Thu, 8 May 2025 17:34:01 +0100 Subject: [PATCH] Adds support for disabling the generation of partitions.yml This allows you to manually create your own variant. You can use the autogenerated one as a template. --- .../skeleton/{{cookiecutter.environment}}/tofu/inventory.tf | 1 + .../skeleton/{{cookiecutter.environment}}/tofu/variables.tf | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/environments/skeleton/{{cookiecutter.environment}}/tofu/inventory.tf b/environments/skeleton/{{cookiecutter.environment}}/tofu/inventory.tf index 0af7eb30b..f86d38205 100644 --- a/environments/skeleton/{{cookiecutter.environment}}/tofu/inventory.tf +++ b/environments/skeleton/{{cookiecutter.environment}}/tofu/inventory.tf @@ -13,6 +13,7 @@ resource "local_file" "hosts" { } resource "local_file" "partitions" { + count = var.autogenerated_partitions_enabled ? 1: 0 content = templatefile("${path.module}/partitions.tpl", { "compute_groups": module.compute, diff --git a/environments/skeleton/{{cookiecutter.environment}}/tofu/variables.tf b/environments/skeleton/{{cookiecutter.environment}}/tofu/variables.tf index 52cc3a605..b26fd506b 100644 --- a/environments/skeleton/{{cookiecutter.environment}}/tofu/variables.tf +++ b/environments/skeleton/{{cookiecutter.environment}}/tofu/variables.tf @@ -24,6 +24,12 @@ variable "key_pair" { description = "Name of an existing keypair in OpenStack" } +variable "autogenerated_partitions_enabled" { + type = bool + description = "Whether or not to template partitions.yml" + default = true +} + variable "control_node_flavor" { type = string description = "Flavor name for control node"