From 76a7935042b006e1bb15f6628661d009803918d7 Mon Sep 17 00:00:00 2001 From: Ben Vincent Date: Sat, 31 May 2025 23:03:23 +1000 Subject: [PATCH 1/2] chore: disable outputs for instance module --- modules/instance/outputs.tf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/instance/outputs.tf b/modules/instance/outputs.tf index 0f0493b..f5d7340 100644 --- a/modules/instance/outputs.tf +++ b/modules/instance/outputs.tf @@ -7,6 +7,6 @@ # } #} -output "hostname" { - value = "${var.name}.${var.cobbler_domain}" -} +#output "hostname" { +# value = "${var.name}.${var.cobbler_domain}" +#} -- 2.47.3 From 6c23fb7b1acb6c3d5fd811183a815355cef3cf96 Mon Sep 17 00:00:00 2001 From: Ben Vincent Date: Sun, 1 Jun 2025 13:36:22 +1000 Subject: [PATCH 2/2] feat: add packagerepo and syncers - add one syncer for packagerepo - add three repo hosts --- config/instances/ausyd1nxvm2058/config.yaml | 14 +++++ .../instances/ausyd1nxvm2058/terragrunt.hcl | 52 +++++++++++++++++++ config/instances/ausyd1nxvm2059/config.yaml | 14 +++++ .../instances/ausyd1nxvm2059/terragrunt.hcl | 52 +++++++++++++++++++ config/instances/ausyd1nxvm2060/config.yaml | 14 +++++ .../instances/ausyd1nxvm2060/terragrunt.hcl | 52 +++++++++++++++++++ config/instances/ausyd1nxvm2061/config.yaml | 14 +++++ .../instances/ausyd1nxvm2061/terragrunt.hcl | 52 +++++++++++++++++++ templates/base/boilerplate.yml | 1 + 9 files changed, 265 insertions(+) create mode 100644 config/instances/ausyd1nxvm2058/config.yaml create mode 100644 config/instances/ausyd1nxvm2058/terragrunt.hcl create mode 100644 config/instances/ausyd1nxvm2059/config.yaml create mode 100644 config/instances/ausyd1nxvm2059/terragrunt.hcl create mode 100644 config/instances/ausyd1nxvm2060/config.yaml create mode 100644 config/instances/ausyd1nxvm2060/terragrunt.hcl create mode 100644 config/instances/ausyd1nxvm2061/config.yaml create mode 100644 config/instances/ausyd1nxvm2061/terragrunt.hcl diff --git a/config/instances/ausyd1nxvm2058/config.yaml b/config/instances/ausyd1nxvm2058/config.yaml new file mode 100644 index 0000000..ae2f6fc --- /dev/null +++ b/config/instances/ausyd1nxvm2058/config.yaml @@ -0,0 +1,14 @@ +description: reposync syncer +cobbler_mgmt_classes: + - roles::infra::reposync::syncer +profiles: + - disk10 + - net_com1_eth0 + - 2core4096 + - shared_apps_packagerepo +storage_volumes: + data: + pool: fastpool + path: /data + config: + size: 50GB diff --git a/config/instances/ausyd1nxvm2058/terragrunt.hcl b/config/instances/ausyd1nxvm2058/terragrunt.hcl new file mode 100644 index 0000000..de7d211 --- /dev/null +++ b/config/instances/ausyd1nxvm2058/terragrunt.hcl @@ -0,0 +1,52 @@ +locals { + node_name = "prodnxsr0010" + config_common = yamldecode(file("${get_terragrunt_dir()}/../config_common.yaml")) + config_specific = yamldecode(file("${get_terragrunt_dir()}/config.yaml")) + config = merge(local.config_common, local.config_specific) + instance_name = basename(get_terragrunt_dir()) +} + +inputs = merge( + { + name = local.instance_name + }, + local.config +) + +include "root" { + path = find_in_parent_folders("root.hcl") +} + +include "instances" { + path = find_in_parent_folders("instances.hcl") + expose = true + merge_strategy = "deep" +} + +dependencies { + paths = ["${get_repo_root()}/config/nodes/${local.node_name}"] +} + +terraform { + source = "${get_repo_root()}/modules/instance" +} + +generate "incus" { + path = "incus.tf" + if_exists = "overwrite_terragrunt" + contents = <<-EOF + provider "incus" { + generate_client_certificates = true + accept_remote_certificate = true + + remote { + name = "${basename(get_terragrunt_dir())}" + scheme = "https" + address = "${yamldecode(file("${get_repo_root()}/config/nodes/${local.node_name}/config.yaml")).node_addr}" + port = "${yamldecode(file("${get_repo_root()}/config/nodes/${local.node_name}/config.yaml")).node_port}" + token = "${get_env("INCUS_TOKEN_${upper(local.node_name)}")}" + default = true + } + } + EOF +} diff --git a/config/instances/ausyd1nxvm2059/config.yaml b/config/instances/ausyd1nxvm2059/config.yaml new file mode 100644 index 0000000..8f8df6c --- /dev/null +++ b/config/instances/ausyd1nxvm2059/config.yaml @@ -0,0 +1,14 @@ +description: reposync repo +cobbler_mgmt_classes: + - roles::infra::reposync::repo +profiles: + - disk10 + - net_com1_eth0 + - 2core2048 + - shared_apps_packagerepo +storage_volumes: + data: + pool: fastpool + path: /data + config: + size: 50GB diff --git a/config/instances/ausyd1nxvm2059/terragrunt.hcl b/config/instances/ausyd1nxvm2059/terragrunt.hcl new file mode 100644 index 0000000..98fe447 --- /dev/null +++ b/config/instances/ausyd1nxvm2059/terragrunt.hcl @@ -0,0 +1,52 @@ +locals { + node_name = "prodnxsr0011" + config_common = yamldecode(file("${get_terragrunt_dir()}/../config_common.yaml")) + config_specific = yamldecode(file("${get_terragrunt_dir()}/config.yaml")) + config = merge(local.config_common, local.config_specific) + instance_name = basename(get_terragrunt_dir()) +} + +inputs = merge( + { + name = local.instance_name + }, + local.config +) + +include "root" { + path = find_in_parent_folders("root.hcl") +} + +include "instances" { + path = find_in_parent_folders("instances.hcl") + expose = true + merge_strategy = "deep" +} + +dependencies { + paths = ["${get_repo_root()}/config/nodes/${local.node_name}"] +} + +terraform { + source = "${get_repo_root()}/modules/instance" +} + +generate "incus" { + path = "incus.tf" + if_exists = "overwrite_terragrunt" + contents = <<-EOF + provider "incus" { + generate_client_certificates = true + accept_remote_certificate = true + + remote { + name = "${basename(get_terragrunt_dir())}" + scheme = "https" + address = "${yamldecode(file("${get_repo_root()}/config/nodes/${local.node_name}/config.yaml")).node_addr}" + port = "${yamldecode(file("${get_repo_root()}/config/nodes/${local.node_name}/config.yaml")).node_port}" + token = "${get_env("INCUS_TOKEN_${upper(local.node_name)}")}" + default = true + } + } + EOF +} diff --git a/config/instances/ausyd1nxvm2060/config.yaml b/config/instances/ausyd1nxvm2060/config.yaml new file mode 100644 index 0000000..8f8df6c --- /dev/null +++ b/config/instances/ausyd1nxvm2060/config.yaml @@ -0,0 +1,14 @@ +description: reposync repo +cobbler_mgmt_classes: + - roles::infra::reposync::repo +profiles: + - disk10 + - net_com1_eth0 + - 2core2048 + - shared_apps_packagerepo +storage_volumes: + data: + pool: fastpool + path: /data + config: + size: 50GB diff --git a/config/instances/ausyd1nxvm2060/terragrunt.hcl b/config/instances/ausyd1nxvm2060/terragrunt.hcl new file mode 100644 index 0000000..b33a99b --- /dev/null +++ b/config/instances/ausyd1nxvm2060/terragrunt.hcl @@ -0,0 +1,52 @@ +locals { + node_name = "prodnxsr0012" + config_common = yamldecode(file("${get_terragrunt_dir()}/../config_common.yaml")) + config_specific = yamldecode(file("${get_terragrunt_dir()}/config.yaml")) + config = merge(local.config_common, local.config_specific) + instance_name = basename(get_terragrunt_dir()) +} + +inputs = merge( + { + name = local.instance_name + }, + local.config +) + +include "root" { + path = find_in_parent_folders("root.hcl") +} + +include "instances" { + path = find_in_parent_folders("instances.hcl") + expose = true + merge_strategy = "deep" +} + +dependencies { + paths = ["${get_repo_root()}/config/nodes/${local.node_name}"] +} + +terraform { + source = "${get_repo_root()}/modules/instance" +} + +generate "incus" { + path = "incus.tf" + if_exists = "overwrite_terragrunt" + contents = <<-EOF + provider "incus" { + generate_client_certificates = true + accept_remote_certificate = true + + remote { + name = "${basename(get_terragrunt_dir())}" + scheme = "https" + address = "${yamldecode(file("${get_repo_root()}/config/nodes/${local.node_name}/config.yaml")).node_addr}" + port = "${yamldecode(file("${get_repo_root()}/config/nodes/${local.node_name}/config.yaml")).node_port}" + token = "${get_env("INCUS_TOKEN_${upper(local.node_name)}")}" + default = true + } + } + EOF +} diff --git a/config/instances/ausyd1nxvm2061/config.yaml b/config/instances/ausyd1nxvm2061/config.yaml new file mode 100644 index 0000000..8f8df6c --- /dev/null +++ b/config/instances/ausyd1nxvm2061/config.yaml @@ -0,0 +1,14 @@ +description: reposync repo +cobbler_mgmt_classes: + - roles::infra::reposync::repo +profiles: + - disk10 + - net_com1_eth0 + - 2core2048 + - shared_apps_packagerepo +storage_volumes: + data: + pool: fastpool + path: /data + config: + size: 50GB diff --git a/config/instances/ausyd1nxvm2061/terragrunt.hcl b/config/instances/ausyd1nxvm2061/terragrunt.hcl new file mode 100644 index 0000000..5326e08 --- /dev/null +++ b/config/instances/ausyd1nxvm2061/terragrunt.hcl @@ -0,0 +1,52 @@ +locals { + node_name = "prodnxsr0013" + config_common = yamldecode(file("${get_terragrunt_dir()}/../config_common.yaml")) + config_specific = yamldecode(file("${get_terragrunt_dir()}/config.yaml")) + config = merge(local.config_common, local.config_specific) + instance_name = basename(get_terragrunt_dir()) +} + +inputs = merge( + { + name = local.instance_name + }, + local.config +) + +include "root" { + path = find_in_parent_folders("root.hcl") +} + +include "instances" { + path = find_in_parent_folders("instances.hcl") + expose = true + merge_strategy = "deep" +} + +dependencies { + paths = ["${get_repo_root()}/config/nodes/${local.node_name}"] +} + +terraform { + source = "${get_repo_root()}/modules/instance" +} + +generate "incus" { + path = "incus.tf" + if_exists = "overwrite_terragrunt" + contents = <<-EOF + provider "incus" { + generate_client_certificates = true + accept_remote_certificate = true + + remote { + name = "${basename(get_terragrunt_dir())}" + scheme = "https" + address = "${yamldecode(file("${get_repo_root()}/config/nodes/${local.node_name}/config.yaml")).node_addr}" + port = "${yamldecode(file("${get_repo_root()}/config/nodes/${local.node_name}/config.yaml")).node_port}" + token = "${get_env("INCUS_TOKEN_${upper(local.node_name)}")}" + default = true + } + } + EOF +} diff --git a/templates/base/boilerplate.yml b/templates/base/boilerplate.yml index 2962b28..ca5620f 100644 --- a/templates/base/boilerplate.yml +++ b/templates/base/boilerplate.yml @@ -73,6 +73,7 @@ variables: - roles::infra::puppetboard::server - roles::infra::puppetdb::api - roles::infra::puppetdb::sql + - roles::infra::reposync::repo - roles::infra::reposync::syncer - roles::infra::sql::galera - roles::infra::sql::patroni -- 2.47.3