Add Terraform plan-to-config reconciliation script

This commit is contained in:
beatz174-bit
2026-04-14 18:19:51 +10:00
parent 5e49b6774b
commit ebae1ed990
2 changed files with 119 additions and 0 deletions
+16
View File
@@ -31,6 +31,22 @@ Current intent:
3. Add Proxmox inventory/configuration scaffolding and imports later.
4. Introduce Ansible workflow after Terraform-managed inventory is trustworthy.
## Plan-to-config helper script
Use `scripts/reconcile_from_plan.sh` to automate Terraform configuration generation from `terraform plan` output (via Terraform's `-generate-config-out`).
From a Terraform module directory (for example `infrastructure/terraform/docker`):
```bash
../../scripts/reconcile_from_plan.sh --output-file zz_generated_from_plan.auto.tf
```
Notes:
- Best used with an import-first workflow that already contains `import {}` blocks.
- The script writes generated config into a `.auto.tf` file and runs `terraform fmt` on it.
- Always review generated arguments before apply.
## Safety notes
- State files are intentionally gitignored for safety and portability.