Merge pull request 'feat: add puppetdb patroni cluster' (#8) from benvin/puppetdb_patroni into master
Reviewed-on: https://git.query.consul/unkin/terraform-incus/pulls/8
This commit is contained in:
commit
3007fbe2aa
13
config/instances/ausyd1nxvm2065/config.yaml
Normal file
13
config/instances/ausyd1nxvm2065/config.yaml
Normal file
@ -0,0 +1,13 @@
|
||||
description: Patroni PuppetDB Prod
|
||||
cobbler_mgmt_classes:
|
||||
- roles::infra::puppetdb::sql
|
||||
profiles:
|
||||
- disk10
|
||||
- net_com1_eth0
|
||||
- 2core4096
|
||||
storage_volumes:
|
||||
data:
|
||||
pool: fastpool
|
||||
path: /data
|
||||
config:
|
||||
size: 50GB
|
||||
52
config/instances/ausyd1nxvm2065/terragrunt.hcl
Normal file
52
config/instances/ausyd1nxvm2065/terragrunt.hcl
Normal file
@ -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
|
||||
}
|
||||
13
config/instances/ausyd1nxvm2066/config.yaml
Normal file
13
config/instances/ausyd1nxvm2066/config.yaml
Normal file
@ -0,0 +1,13 @@
|
||||
description: Patroni PuppetDB Prod
|
||||
cobbler_mgmt_classes:
|
||||
- roles::infra::puppetdb::sql
|
||||
profiles:
|
||||
- disk10
|
||||
- net_com1_eth0
|
||||
- 2core4096
|
||||
storage_volumes:
|
||||
data:
|
||||
pool: fastpool
|
||||
path: /data
|
||||
config:
|
||||
size: 50GB
|
||||
52
config/instances/ausyd1nxvm2066/terragrunt.hcl
Normal file
52
config/instances/ausyd1nxvm2066/terragrunt.hcl
Normal file
@ -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
|
||||
}
|
||||
13
config/instances/ausyd1nxvm2067/config.yaml
Normal file
13
config/instances/ausyd1nxvm2067/config.yaml
Normal file
@ -0,0 +1,13 @@
|
||||
description: Patroni PuppetDB Prod
|
||||
cobbler_mgmt_classes:
|
||||
- roles::infra::puppetdb::sql
|
||||
profiles:
|
||||
- disk10
|
||||
- net_com1_eth0
|
||||
- 2core4096
|
||||
storage_volumes:
|
||||
data:
|
||||
pool: fastpool
|
||||
path: /data
|
||||
config:
|
||||
size: 50GB
|
||||
52
config/instances/ausyd1nxvm2067/terragrunt.hcl
Normal file
52
config/instances/ausyd1nxvm2067/terragrunt.hcl
Normal file
@ -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
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user