From 25700185bcd0fe304efce9246383386e114712cd Mon Sep 17 00:00:00 2001 From: Ben Vincent Date: Tue, 8 Jul 2025 20:11:19 +1000 Subject: [PATCH 1/2] chore: update makefile, add roles - add victoriametrics cluster roles - change terragrunt to be 8 threads for plan --- Makefile | 2 +- templates/base/boilerplate.yml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f59e8f3..30df1d7 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ init: plan: init @$(call vault_env) && \ - terragrunt run-all --terragrunt-non-interactive plan + terragrunt run-all --terragrunt-parallelism 8 --terragrunt-non-interactive plan apply: @$(call vault_env) && \ diff --git a/templates/base/boilerplate.yml b/templates/base/boilerplate.yml index 99d8e5e..bbfed08 100644 --- a/templates/base/boilerplate.yml +++ b/templates/base/boilerplate.yml @@ -62,6 +62,9 @@ variables: - roles::infra::k8s::worker - roles::infra::metrics::grafana - roles::infra::metrics::prometheus + - roles::infra::metrics::vmstorage + - roles::infra::metrics::vminsert + - roles::infra::metrics::vmselect - roles::infra::nomad::agent - roles::infra::nomad::agentv2 - roles::infra::nomad::server From 3181ae453d6dab38cdd4a6b26e5d6857aa4d3095 Mon Sep 17 00:00:00 2001 From: Ben Vincent Date: Wed, 9 Jul 2025 19:34:45 +1000 Subject: [PATCH 2/2] feat: add vicmet hosts - add 5 vmstorage - add 3 vmselect - add 3 vminsert - update boilerplate config --- config/instances/ausyd1nxvm2086/config.yaml | 13 +++++ .../instances/ausyd1nxvm2086/terragrunt.hcl | 52 +++++++++++++++++++ config/instances/ausyd1nxvm2087/config.yaml | 13 +++++ .../instances/ausyd1nxvm2087/terragrunt.hcl | 52 +++++++++++++++++++ config/instances/ausyd1nxvm2088/config.yaml | 13 +++++ .../instances/ausyd1nxvm2088/terragrunt.hcl | 52 +++++++++++++++++++ config/instances/ausyd1nxvm2089/config.yaml | 13 +++++ .../instances/ausyd1nxvm2089/terragrunt.hcl | 52 +++++++++++++++++++ config/instances/ausyd1nxvm2090/config.yaml | 13 +++++ .../instances/ausyd1nxvm2090/terragrunt.hcl | 52 +++++++++++++++++++ config/instances/ausyd1nxvm2091/config.yaml | 7 +++ .../instances/ausyd1nxvm2091/terragrunt.hcl | 52 +++++++++++++++++++ config/instances/ausyd1nxvm2092/config.yaml | 7 +++ .../instances/ausyd1nxvm2092/terragrunt.hcl | 52 +++++++++++++++++++ config/instances/ausyd1nxvm2093/config.yaml | 7 +++ .../instances/ausyd1nxvm2093/terragrunt.hcl | 52 +++++++++++++++++++ config/instances/ausyd1nxvm2094/config.yaml | 7 +++ .../instances/ausyd1nxvm2094/terragrunt.hcl | 52 +++++++++++++++++++ config/instances/ausyd1nxvm2095/config.yaml | 7 +++ .../instances/ausyd1nxvm2095/terragrunt.hcl | 52 +++++++++++++++++++ config/instances/ausyd1nxvm2096/config.yaml | 7 +++ .../instances/ausyd1nxvm2096/terragrunt.hcl | 52 +++++++++++++++++++ 22 files changed, 679 insertions(+) create mode 100644 config/instances/ausyd1nxvm2086/config.yaml create mode 100644 config/instances/ausyd1nxvm2086/terragrunt.hcl create mode 100644 config/instances/ausyd1nxvm2087/config.yaml create mode 100644 config/instances/ausyd1nxvm2087/terragrunt.hcl create mode 100644 config/instances/ausyd1nxvm2088/config.yaml create mode 100644 config/instances/ausyd1nxvm2088/terragrunt.hcl create mode 100644 config/instances/ausyd1nxvm2089/config.yaml create mode 100644 config/instances/ausyd1nxvm2089/terragrunt.hcl create mode 100644 config/instances/ausyd1nxvm2090/config.yaml create mode 100644 config/instances/ausyd1nxvm2090/terragrunt.hcl create mode 100644 config/instances/ausyd1nxvm2091/config.yaml create mode 100644 config/instances/ausyd1nxvm2091/terragrunt.hcl create mode 100644 config/instances/ausyd1nxvm2092/config.yaml create mode 100644 config/instances/ausyd1nxvm2092/terragrunt.hcl create mode 100644 config/instances/ausyd1nxvm2093/config.yaml create mode 100644 config/instances/ausyd1nxvm2093/terragrunt.hcl create mode 100644 config/instances/ausyd1nxvm2094/config.yaml create mode 100644 config/instances/ausyd1nxvm2094/terragrunt.hcl create mode 100644 config/instances/ausyd1nxvm2095/config.yaml create mode 100644 config/instances/ausyd1nxvm2095/terragrunt.hcl create mode 100644 config/instances/ausyd1nxvm2096/config.yaml create mode 100644 config/instances/ausyd1nxvm2096/terragrunt.hcl diff --git a/config/instances/ausyd1nxvm2086/config.yaml b/config/instances/ausyd1nxvm2086/config.yaml new file mode 100644 index 0000000..f561208 --- /dev/null +++ b/config/instances/ausyd1nxvm2086/config.yaml @@ -0,0 +1,13 @@ +description: VicMet-vmstorage +cobbler_mgmt_classes: + - roles::infra::metrics::vmstorage +profiles: + - disk10 + - net_com1_eth0 + - 2core2048 +storage_volumes: + data: + pool: fastpool + path: /data + config: + size: 100GB diff --git a/config/instances/ausyd1nxvm2086/terragrunt.hcl b/config/instances/ausyd1nxvm2086/terragrunt.hcl new file mode 100644 index 0000000..c3099a9 --- /dev/null +++ b/config/instances/ausyd1nxvm2086/terragrunt.hcl @@ -0,0 +1,52 @@ +locals { + node_name = "prodnxsr0009" + 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/ausyd1nxvm2087/config.yaml b/config/instances/ausyd1nxvm2087/config.yaml new file mode 100644 index 0000000..f561208 --- /dev/null +++ b/config/instances/ausyd1nxvm2087/config.yaml @@ -0,0 +1,13 @@ +description: VicMet-vmstorage +cobbler_mgmt_classes: + - roles::infra::metrics::vmstorage +profiles: + - disk10 + - net_com1_eth0 + - 2core2048 +storage_volumes: + data: + pool: fastpool + path: /data + config: + size: 100GB diff --git a/config/instances/ausyd1nxvm2087/terragrunt.hcl b/config/instances/ausyd1nxvm2087/terragrunt.hcl new file mode 100644 index 0000000..de7d211 --- /dev/null +++ b/config/instances/ausyd1nxvm2087/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/ausyd1nxvm2088/config.yaml b/config/instances/ausyd1nxvm2088/config.yaml new file mode 100644 index 0000000..f561208 --- /dev/null +++ b/config/instances/ausyd1nxvm2088/config.yaml @@ -0,0 +1,13 @@ +description: VicMet-vmstorage +cobbler_mgmt_classes: + - roles::infra::metrics::vmstorage +profiles: + - disk10 + - net_com1_eth0 + - 2core2048 +storage_volumes: + data: + pool: fastpool + path: /data + config: + size: 100GB diff --git a/config/instances/ausyd1nxvm2088/terragrunt.hcl b/config/instances/ausyd1nxvm2088/terragrunt.hcl new file mode 100644 index 0000000..98fe447 --- /dev/null +++ b/config/instances/ausyd1nxvm2088/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/ausyd1nxvm2089/config.yaml b/config/instances/ausyd1nxvm2089/config.yaml new file mode 100644 index 0000000..f561208 --- /dev/null +++ b/config/instances/ausyd1nxvm2089/config.yaml @@ -0,0 +1,13 @@ +description: VicMet-vmstorage +cobbler_mgmt_classes: + - roles::infra::metrics::vmstorage +profiles: + - disk10 + - net_com1_eth0 + - 2core2048 +storage_volumes: + data: + pool: fastpool + path: /data + config: + size: 100GB diff --git a/config/instances/ausyd1nxvm2089/terragrunt.hcl b/config/instances/ausyd1nxvm2089/terragrunt.hcl new file mode 100644 index 0000000..b33a99b --- /dev/null +++ b/config/instances/ausyd1nxvm2089/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/ausyd1nxvm2090/config.yaml b/config/instances/ausyd1nxvm2090/config.yaml new file mode 100644 index 0000000..f561208 --- /dev/null +++ b/config/instances/ausyd1nxvm2090/config.yaml @@ -0,0 +1,13 @@ +description: VicMet-vmstorage +cobbler_mgmt_classes: + - roles::infra::metrics::vmstorage +profiles: + - disk10 + - net_com1_eth0 + - 2core2048 +storage_volumes: + data: + pool: fastpool + path: /data + config: + size: 100GB diff --git a/config/instances/ausyd1nxvm2090/terragrunt.hcl b/config/instances/ausyd1nxvm2090/terragrunt.hcl new file mode 100644 index 0000000..5326e08 --- /dev/null +++ b/config/instances/ausyd1nxvm2090/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/config/instances/ausyd1nxvm2091/config.yaml b/config/instances/ausyd1nxvm2091/config.yaml new file mode 100644 index 0000000..b151136 --- /dev/null +++ b/config/instances/ausyd1nxvm2091/config.yaml @@ -0,0 +1,7 @@ +description: VicMet-vminsert +cobbler_mgmt_classes: + - roles::infra::metrics::vminsert +profiles: + - disk20 + - net_com1_eth0 + - 2core2048 diff --git a/config/instances/ausyd1nxvm2091/terragrunt.hcl b/config/instances/ausyd1nxvm2091/terragrunt.hcl new file mode 100644 index 0000000..c3099a9 --- /dev/null +++ b/config/instances/ausyd1nxvm2091/terragrunt.hcl @@ -0,0 +1,52 @@ +locals { + node_name = "prodnxsr0009" + 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/ausyd1nxvm2092/config.yaml b/config/instances/ausyd1nxvm2092/config.yaml new file mode 100644 index 0000000..b151136 --- /dev/null +++ b/config/instances/ausyd1nxvm2092/config.yaml @@ -0,0 +1,7 @@ +description: VicMet-vminsert +cobbler_mgmt_classes: + - roles::infra::metrics::vminsert +profiles: + - disk20 + - net_com1_eth0 + - 2core2048 diff --git a/config/instances/ausyd1nxvm2092/terragrunt.hcl b/config/instances/ausyd1nxvm2092/terragrunt.hcl new file mode 100644 index 0000000..de7d211 --- /dev/null +++ b/config/instances/ausyd1nxvm2092/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/ausyd1nxvm2093/config.yaml b/config/instances/ausyd1nxvm2093/config.yaml new file mode 100644 index 0000000..b151136 --- /dev/null +++ b/config/instances/ausyd1nxvm2093/config.yaml @@ -0,0 +1,7 @@ +description: VicMet-vminsert +cobbler_mgmt_classes: + - roles::infra::metrics::vminsert +profiles: + - disk20 + - net_com1_eth0 + - 2core2048 diff --git a/config/instances/ausyd1nxvm2093/terragrunt.hcl b/config/instances/ausyd1nxvm2093/terragrunt.hcl new file mode 100644 index 0000000..98fe447 --- /dev/null +++ b/config/instances/ausyd1nxvm2093/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/ausyd1nxvm2094/config.yaml b/config/instances/ausyd1nxvm2094/config.yaml new file mode 100644 index 0000000..c551ed4 --- /dev/null +++ b/config/instances/ausyd1nxvm2094/config.yaml @@ -0,0 +1,7 @@ +description: VicMet-vmselect +cobbler_mgmt_classes: + - roles::infra::metrics::vmselect +profiles: + - disk20 + - net_com1_eth0 + - 2core2048 diff --git a/config/instances/ausyd1nxvm2094/terragrunt.hcl b/config/instances/ausyd1nxvm2094/terragrunt.hcl new file mode 100644 index 0000000..b33a99b --- /dev/null +++ b/config/instances/ausyd1nxvm2094/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/ausyd1nxvm2095/config.yaml b/config/instances/ausyd1nxvm2095/config.yaml new file mode 100644 index 0000000..c551ed4 --- /dev/null +++ b/config/instances/ausyd1nxvm2095/config.yaml @@ -0,0 +1,7 @@ +description: VicMet-vmselect +cobbler_mgmt_classes: + - roles::infra::metrics::vmselect +profiles: + - disk20 + - net_com1_eth0 + - 2core2048 diff --git a/config/instances/ausyd1nxvm2095/terragrunt.hcl b/config/instances/ausyd1nxvm2095/terragrunt.hcl new file mode 100644 index 0000000..5326e08 --- /dev/null +++ b/config/instances/ausyd1nxvm2095/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/config/instances/ausyd1nxvm2096/config.yaml b/config/instances/ausyd1nxvm2096/config.yaml new file mode 100644 index 0000000..c551ed4 --- /dev/null +++ b/config/instances/ausyd1nxvm2096/config.yaml @@ -0,0 +1,7 @@ +description: VicMet-vmselect +cobbler_mgmt_classes: + - roles::infra::metrics::vmselect +profiles: + - disk20 + - net_com1_eth0 + - 2core2048 diff --git a/config/instances/ausyd1nxvm2096/terragrunt.hcl b/config/instances/ausyd1nxvm2096/terragrunt.hcl new file mode 100644 index 0000000..c3099a9 --- /dev/null +++ b/config/instances/ausyd1nxvm2096/terragrunt.hcl @@ -0,0 +1,52 @@ +locals { + node_name = "prodnxsr0009" + 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 +}