用统一 inventory 生成 DNS 后端配置 #81

Merged
panxiao81 merged 2 commits from feat/dns-config-generator into main 2026-09-16 18:43:02 +00:00
Owner

内容

  • 新增基于 Jinja2/PyYAML 的 infrastructure/dns/generate.py
  • 从 records.yml 生成 Blocky split-horizon mapping、CoreDNS server blocks 和已接管的 Cloudflare Terraform records
  • 使用 backends 与 terraform.managed 明确分阶段接管边界
  • 生成结果继续提交进 Git,便于 PR review
  • YAML CI 执行生成器 --check,阻止手工漂移或漏跑生成器

安全性

  • Blocky mapping 与变更前语义完全一致
  • CoreDNS ConfigMap data 与变更前完全一致
  • obj.ddupan.top 暂不加入 CoreDNS,避免夹带行为变更
  • Cloudflare 仍使用原 resource address cloudflare_dns_record.auth
  • git/obj/e5renew 保持 terraform.managed: false,本 PR 不创建或导入公网记录
  • 不修改线上 DNS、DHCP 或 Terraform state

验证

  • 生成后再次 --check:无差异
  • yamllint:通过
  • terraform fmt check:通过
  • Docker Compose config:通过
  • CoreDNS manifest client dry-run:通过
  • Blocky/CoreDNS YAML 语义对比:完全一致
## 内容 - 新增基于 Jinja2/PyYAML 的 `infrastructure/dns/generate.py` - 从 `records.yml` 生成 Blocky split-horizon mapping、CoreDNS server blocks 和已接管的 Cloudflare Terraform records - 使用 `backends` 与 `terraform.managed` 明确分阶段接管边界 - 生成结果继续提交进 Git,便于 PR review - YAML CI 执行生成器 `--check`,阻止手工漂移或漏跑生成器 ## 安全性 - Blocky mapping 与变更前语义完全一致 - CoreDNS ConfigMap `data` 与变更前完全一致 - `obj.ddupan.top` 暂不加入 CoreDNS,避免夹带行为变更 - Cloudflare 仍使用原 resource address `cloudflare_dns_record.auth` - `git/obj/e5renew` 保持 `terraform.managed: false`,本 PR 不创建或导入公网记录 - 不修改线上 DNS、DHCP 或 Terraform state ## 验证 - 生成后再次 `--check`:无差异 - yamllint:通过 - terraform fmt check:通过 - Docker Compose config:通过 - CoreDNS manifest client dry-run:通过 - Blocky/CoreDNS YAML 语义对比:完全一致
panxiao81 added 1 commit 2026-09-16 18:27:32 +00:00
feat(dns): 用模板生成各后端配置
yaml / yaml (pull_request) Successful in 23s
terraform / validate (pull_request) Successful in 36s
ansible / collection-test (pull_request) Successful in 1m33s
ansible / lint (pull_request) Failing after 2m44s
5241eceb0c
panxiao81 added 1 commit 2026-09-16 18:38:01 +00:00
fix(ci): 为 Ansible lint 提供临时 Vault 占位文件
yaml / yaml (pull_request) Successful in 28s
terraform / validate (pull_request) Successful in 36s
ansible / collection-test (pull_request) Successful in 1m24s
ansible / lint (pull_request) Successful in 3m11s
65a72ce7fa
panxiao81 merged commit 76f94f4f31 into main 2026-09-16 18:43:02 +00:00
panxiao81 deleted branch feat/dns-config-generator 2026-09-16 18:43:02 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: panxiao81/homelab-infra#81