From 23cc04002e5d6e833fcc2008359106471a6d6418 Mon Sep 17 00:00:00 2001 From: Ben Vincent Date: Wed, 2 Jul 2025 19:34:15 +1000 Subject: [PATCH 1/4] feat: add git server role - new role for git servers - adding to boilerplate config --- templates/base/boilerplate.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/base/boilerplate.yml b/templates/base/boilerplate.yml index 372ffd3..bd70d75 100644 --- a/templates/base/boilerplate.yml +++ b/templates/base/boilerplate.yml @@ -51,6 +51,7 @@ variables: - roles::infra::etcd::node - roles::infra::git::gitea - roles::infra::git::runner + - roles::infra::git::server - roles::infra::halb::haproxy - roles::infra::halb::haproxy2 - roles::infra::incus::imagehost -- 2.47.3 From ee6a98ba740b1ca15feb9b2f3adfc77af26e9b1a Mon Sep 17 00:00:00 2001 From: Ben Vincent Date: Sat, 5 Jul 2025 16:42:50 +1000 Subject: [PATCH 2/4] feat: add gitea servers - add three gitea servers --- config/instances/ausyd1nxvm2080/config.yaml | 8 +++ .../instances/ausyd1nxvm2080/terragrunt.hcl | 52 +++++++++++++++++++ config/instances/ausyd1nxvm2081/config.yaml | 8 +++ .../instances/ausyd1nxvm2081/terragrunt.hcl | 52 +++++++++++++++++++ config/instances/ausyd1nxvm2082/config.yaml | 8 +++ .../instances/ausyd1nxvm2082/terragrunt.hcl | 52 +++++++++++++++++++ 6 files changed, 180 insertions(+) create mode 100644 config/instances/ausyd1nxvm2080/config.yaml create mode 100644 config/instances/ausyd1nxvm2080/terragrunt.hcl create mode 100644 config/instances/ausyd1nxvm2081/config.yaml create mode 100644 config/instances/ausyd1nxvm2081/terragrunt.hcl create mode 100644 config/instances/ausyd1nxvm2082/config.yaml create mode 100644 config/instances/ausyd1nxvm2082/terragrunt.hcl diff --git a/config/instances/ausyd1nxvm2080/config.yaml b/config/instances/ausyd1nxvm2080/config.yaml new file mode 100644 index 0000000..5a50712 --- /dev/null +++ b/config/instances/ausyd1nxvm2080/config.yaml @@ -0,0 +1,8 @@ +description: GiteaServer +cobbler_mgmt_classes: + - roles::infra::git::server +profiles: + - disk10 + - net_com1_eth0 + - 2core2048 + - shared_apps_gitea diff --git a/config/instances/ausyd1nxvm2080/terragrunt.hcl b/config/instances/ausyd1nxvm2080/terragrunt.hcl new file mode 100644 index 0000000..de7d211 --- /dev/null +++ b/config/instances/ausyd1nxvm2080/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/ausyd1nxvm2081/config.yaml b/config/instances/ausyd1nxvm2081/config.yaml new file mode 100644 index 0000000..5a50712 --- /dev/null +++ b/config/instances/ausyd1nxvm2081/config.yaml @@ -0,0 +1,8 @@ +description: GiteaServer +cobbler_mgmt_classes: + - roles::infra::git::server +profiles: + - disk10 + - net_com1_eth0 + - 2core2048 + - shared_apps_gitea diff --git a/config/instances/ausyd1nxvm2081/terragrunt.hcl b/config/instances/ausyd1nxvm2081/terragrunt.hcl new file mode 100644 index 0000000..98fe447 --- /dev/null +++ b/config/instances/ausyd1nxvm2081/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/ausyd1nxvm2082/config.yaml b/config/instances/ausyd1nxvm2082/config.yaml new file mode 100644 index 0000000..5a50712 --- /dev/null +++ b/config/instances/ausyd1nxvm2082/config.yaml @@ -0,0 +1,8 @@ +description: GiteaServer +cobbler_mgmt_classes: + - roles::infra::git::server +profiles: + - disk10 + - net_com1_eth0 + - 2core2048 + - shared_apps_gitea diff --git a/config/instances/ausyd1nxvm2082/terragrunt.hcl b/config/instances/ausyd1nxvm2082/terragrunt.hcl new file mode 100644 index 0000000..b33a99b --- /dev/null +++ b/config/instances/ausyd1nxvm2082/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 +} -- 2.47.3 From 903027018e8fe8013ea0c3a0f8f3c5d28c2c431b Mon Sep 17 00:00:00 2001 From: Ben Vincent Date: Sat, 5 Jul 2025 16:44:02 +1000 Subject: [PATCH 3/4] feat: add gitea redis cluster - add three instances for redisha (sentinel+redis) - used for cache/queues on gitea --- config/instances/ausyd1nxvm2083/config.yaml | 7 +++ .../instances/ausyd1nxvm2083/terragrunt.hcl | 52 +++++++++++++++++++ config/instances/ausyd1nxvm2084/config.yaml | 7 +++ .../instances/ausyd1nxvm2084/terragrunt.hcl | 52 +++++++++++++++++++ config/instances/ausyd1nxvm2085/config.yaml | 7 +++ .../instances/ausyd1nxvm2085/terragrunt.hcl | 52 +++++++++++++++++++ 6 files changed, 177 insertions(+) create mode 100644 config/instances/ausyd1nxvm2083/config.yaml create mode 100644 config/instances/ausyd1nxvm2083/terragrunt.hcl create mode 100644 config/instances/ausyd1nxvm2084/config.yaml create mode 100644 config/instances/ausyd1nxvm2084/terragrunt.hcl create mode 100644 config/instances/ausyd1nxvm2085/config.yaml create mode 100644 config/instances/ausyd1nxvm2085/terragrunt.hcl diff --git a/config/instances/ausyd1nxvm2083/config.yaml b/config/instances/ausyd1nxvm2083/config.yaml new file mode 100644 index 0000000..eafe8fd --- /dev/null +++ b/config/instances/ausyd1nxvm2083/config.yaml @@ -0,0 +1,7 @@ +description: Redis4Gitea +cobbler_mgmt_classes: + - roles::infra::git::redis +profiles: + - disk20 + - net_com1_eth0 + - 2core2048 diff --git a/config/instances/ausyd1nxvm2083/terragrunt.hcl b/config/instances/ausyd1nxvm2083/terragrunt.hcl new file mode 100644 index 0000000..5326e08 --- /dev/null +++ b/config/instances/ausyd1nxvm2083/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/ausyd1nxvm2084/config.yaml b/config/instances/ausyd1nxvm2084/config.yaml new file mode 100644 index 0000000..eafe8fd --- /dev/null +++ b/config/instances/ausyd1nxvm2084/config.yaml @@ -0,0 +1,7 @@ +description: Redis4Gitea +cobbler_mgmt_classes: + - roles::infra::git::redis +profiles: + - disk20 + - net_com1_eth0 + - 2core2048 diff --git a/config/instances/ausyd1nxvm2084/terragrunt.hcl b/config/instances/ausyd1nxvm2084/terragrunt.hcl new file mode 100644 index 0000000..c3099a9 --- /dev/null +++ b/config/instances/ausyd1nxvm2084/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/ausyd1nxvm2085/config.yaml b/config/instances/ausyd1nxvm2085/config.yaml new file mode 100644 index 0000000..eafe8fd --- /dev/null +++ b/config/instances/ausyd1nxvm2085/config.yaml @@ -0,0 +1,7 @@ +description: Redis4Gitea +cobbler_mgmt_classes: + - roles::infra::git::redis +profiles: + - disk20 + - net_com1_eth0 + - 2core2048 diff --git a/config/instances/ausyd1nxvm2085/terragrunt.hcl b/config/instances/ausyd1nxvm2085/terragrunt.hcl new file mode 100644 index 0000000..de7d211 --- /dev/null +++ b/config/instances/ausyd1nxvm2085/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 +} -- 2.47.3 From 73bb7fdd7699c24e27868461057ecdb0485a848e Mon Sep 17 00:00:00 2001 From: Ben Vincent Date: Sat, 5 Jul 2025 16:45:46 +1000 Subject: [PATCH 4/4] feat: add git::redis role to list - add new role to boilerplate --- templates/base/boilerplate.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/base/boilerplate.yml b/templates/base/boilerplate.yml index bd70d75..99d8e5e 100644 --- a/templates/base/boilerplate.yml +++ b/templates/base/boilerplate.yml @@ -50,6 +50,7 @@ variables: - roles::infra::droneci::server - roles::infra::etcd::node - roles::infra::git::gitea + - roles::infra::git::redis - roles::infra::git::runner - roles::infra::git::server - roles::infra::halb::haproxy -- 2.47.3