054110d748
terragrunt-enc is the single source of truth for encapi ENC data (Puppet statuses, roles, and node classifications), managed with Terraform/Terragrunt. It supersedes Cobbler classification for Puppet and the terraform-incus dual-write prototype (PR #39). - Add modules/encapi (encapi_status / encapi_role / encapi_node, nodes FK-ordered after their role and status). - Add config/encapi leaf: 3 statuses, 51 roles, and 143 node assignments (130 container VMs env production + 13 prodnxsr physicals env develop), all YAML-driven. - Add config/root.hcl (consul backend infra/terraform/enc/<leaf>/state) and the encapi provider from the artifactapi registry (v0.1.0). - Add Makefile, Woodpecker pre-commit/plan/apply pipelines, pre-commit config, ci/extract_incus_nodes.py, and expand the README.
30 lines
719 B
Terraform
30 lines
719 B
Terraform
resource "encapi_status" "this" {
|
|
for_each = var.statuses
|
|
|
|
name = each.key
|
|
description = each.value.description
|
|
}
|
|
|
|
resource "encapi_role" "this" {
|
|
for_each = var.roles
|
|
|
|
name = each.key
|
|
description = each.value.description
|
|
default_params = each.value.default_params == null ? null : jsonencode(each.value.default_params)
|
|
}
|
|
|
|
resource "encapi_node" "this" {
|
|
for_each = var.nodes
|
|
|
|
certname = each.key
|
|
role = each.value.role
|
|
environment = each.value.environment
|
|
params = each.value.params == null ? null : jsonencode(each.value.params)
|
|
|
|
# Nodes FK-require their role and status to exist first.
|
|
depends_on = [
|
|
encapi_role.this,
|
|
encapi_status.this,
|
|
]
|
|
}
|