Commit Graph
22 Commits
Author SHA1 Message Date
Damien 6c4e3c31b0 Merge pull request 'Remove unused virtual machines from prod config' (#17) from vm/delete_all into dev
Terraform Deploy / Validate (push) Successful in 5s
Terraform Deploy / Plan (push) Successful in 6s
Terraform Deploy / Apply (push) Successful in 11s
Reviewed-on: #17
2026-06-10 07:40:24 +00:00
Damien 452ebb1ac0 Merge pull request 'Add DNS server configuration for Alpine Linux' (#16) from fix/alpine_dns into dev
Terraform Deploy / Validate (push) Successful in 4s
Terraform Deploy / Apply (push) Has been cancelled
Terraform Deploy / Plan (push) Has been cancelled
Reviewed-on: #16
2026-06-10 07:15:26 +00:00
Damien a5d1e2b817 Merge branch 'dev' into fix/alpine_dns
Terraform PR / Validate (pull_request) Successful in 4s
Terraform PR / Plan (pull_request) Has been cancelled
2026-06-10 07:12:31 +00:00
Damien 43ba14df60 Merge pull request 'chore/fix_qemu_alpine' (#15) from chore/fix_qemu_alpine into dev
Terraform Deploy / Validate (push) Successful in 5s
Terraform Deploy / Plan (push) Successful in 4s
Terraform Deploy / Apply (push) Successful in 15m18s
Reviewed-on: #15
2026-06-10 06:22:44 +00:00
Damien b652694b26 Merge pull request 'Add komodo VM to prod configuration' (#14) from vm/komodo into dev
Terraform Deploy / Validate (push) Successful in 5s
Terraform Deploy / Plan (push) Successful in 5s
Terraform Deploy / Apply (push) Successful in 15m14s
Reviewed-on: #14
2026-06-09 17:35:44 +00:00
Damien 12e413f2a7 Merge pull request 'feat: support SSH key injection via Gitea secrets for CI pipelines' (#12) from feat/ci-ssh-key-support into dev
Terraform Deploy / Validate (push) Successful in 7s
Terraform Deploy / Plan (push) Successful in 9s
Terraform Deploy / Apply (push) Has been skipped
Reviewed-on: #12
2026-05-03 17:41:11 +00:00
Damien f57f68b6f3 feat: add SSH key env vars to PR workflow
Terraform PR / Validate (pull_request) Successful in 6s
Terraform PR / Plan (pull_request) Successful in 10s
Inject PROXMOX_SSH_PRIVATE_KEY and ADMIN_SSH_PUBLIC_KEY
secrets as TF_VAR_ environment variables for CI.
2026-05-03 17:04:10 +00:00
Damien b4fa69f00a feat: add SSH key env vars to deploy workflow
Inject PROXMOX_SSH_PRIVATE_KEY and ADMIN_SSH_PUBLIC_KEY
secrets as TF_VAR_ environment variables for CI.
2026-05-03 17:03:33 +00:00
Damien 8fcf033145 feat: support SSH public key content for CI
Use admin_ssh_public_key content when provided, otherwise
fall back to reading from admin_ssh_public_key_path file.
2026-05-03 17:03:00 +00:00
Damien c495b40def feat: support SSH private key injection for CI
Use proxmox_ssh_private_key variable when available, otherwise
fall back to SSH agent for local development.
2026-05-03 17:02:47 +00:00
Damien 3bb9c97d69 feat: add SSH key variables for CI support
Add proxmox_ssh_private_key for provider SSH in CI pipelines.
Add admin_ssh_public_key as content-based alternative to file path.
Both default to empty string for backward compatibility with local usage.
2026-05-03 17:02:31 +00:00
Damien 9b0fc389c5 Merge pull request 'Test destroy' (#9) from destroy_TestVM into dev
Terraform Deploy / Validate (push) Successful in 4s
Terraform Deploy / Plan (push) Successful in 4s
Terraform Deploy / Apply (push) Has been skipped
Reviewed-on: #9
2025-12-08 18:13:48 +00:00
Damien 7bae079670 refactor(ci): remove old unified workflow
Replaced by:
- terraform-pr.yml (for pull requests)
- terraform-deploy.yml (for push to dev)

Refs #3
2025-12-08 16:27:03 +00:00
Damien 804b94a837 feat(ci): create dedicated deploy workflow for Terraform
Terraform Deploy / Validate (push) Successful in 4s
Terraform Deploy / Plan (push) Successful in 4s
Terraform Deploy / Apply (push) Has been skipped
- Separate workflow for push events to dev only
- Apply job runs when plan detects changes
- Use has_changes output (true/false) instead of exitcode

Refs #3
2025-12-08 16:26:44 +00:00
Damien 349f967fc0 feat(ci): create dedicated PR workflow for Terraform
- Separate workflow for pull_request events only
- No Apply job visible in PR checks
- Simplified checkout using gitea.head_ref directly

Refs #3
2025-12-08 16:26:26 +00:00
Damien e22b8c4aaf Merge pull request 'VM Test' (#8) from deploy_TestVM into dev
Terraform CI/CD / Validate (push) Successful in 5s
Terraform CI/CD / Plan (push) Successful in 4s
Terraform CI/CD / Apply (push) Has been skipped
Reviewed-on: #8
2025-12-08 16:21:13 +00:00
Damien bf80e60d7f fix(ci): use head_ref for PR checkout instead of ref_name
Terraform CI/CD / Validate (push) Successful in 5s
Terraform CI/CD / Plan (push) Successful in 5s
Terraform CI/CD / Apply (push) Has been skipped
- gitea.ref_name returns PR number for pull_request events
- Use gitea.head_ref (source branch) for PRs
- Use gitea.ref_name for push events
- Remove unnecessary git checkout sha step
- Clean up redundant Save Plan Output step

Refs #3
2025-12-08 15:56:31 +00:00
Damien ba4b530635 fix(ci): replace actions/checkout with git clone
Terraform CI/CD / Validate (push) Failing after 1s
Terraform CI/CD / Plan (push) Has been skipped
Terraform CI/CD / Apply (push) Has been skipped
- Remove actions/checkout@v4 (requires Node.js not in Alpine image)
- Use native git clone instead
- Remove actions/upload-artifact and download-artifact (require Node.js)
- Re-run plan in apply job instead of artifact transfer
- Add workflow file to paths trigger for testing

Refs #3
2025-12-08 09:00:24 +00:00
Damien 6036783cd5 feat(ci): Add Terraform CI/CD pipeline (#4)
## Description

Mise en place d'un pipeline CI/CD Gitea Actions pour automatiser le déploiement Terraform.

## Changements

- Ajout du workflow `.gitea/workflows/terraform.yml`
- Utilisation de l'image custom `gitea.arnodo.fr/damien/terraform-ci:latest` (Terraform 1.5.7 + TFLint)
- Exécution dans des containers Docker (pas sur le host)

## Pipeline

| Job | Trigger | Actions |
|-----|---------|---------|
| **validate** | Push + PR | `terraform fmt -check`, `tflint`, `terraform validate` |
| **plan** | Push + PR | `terraform plan` + commentaire automatique sur la PR |
| **apply** | Push sur `dev` uniquement | `terraform apply` (si changements détectés) |

## Secrets configurés

- [x] `AWS_ACCESS_KEY_ID`
- [x] `AWS_SECRET_ACCESS_KEY`
- [x] `PROXMOX_URL`
- [x] `PROXMOX_API_TOKEN`
- [x] `TAILSCALE_AUTH_KEY`
- [x] `GIT_TOKEN`

## Test

Cette PR va déclencher les jobs `validate` et `plan`. Le job `apply` se déclenchera après le merge sur `dev`.

Closes #3

Reviewed-on: #4
2025-12-08 08:52:43 +00:00
Damien f4d55cc062 fix: use legacy S3 backend syntax for Terraform compatibility
Replace 'endpoints' block with 'endpoint' string and remove
unsupported arguments for older Terraform versions.
2025-12-07 13:33:55 +00:00
Damien 086bc029c0 feat: add Scaleway S3 backend for Terraform state
Configure remote state storage using Scaleway Object Storage bucket
'netlab-terraform-backend' for centralized state management.
2025-12-07 13:31:02 +00:00
Damienanddarnodo 90232da467 docs: add Proxmox setup guide for Terraform (#2)
## Summary

Add Proxmox setup documentation for Terraform with dedicated role and minimal privileges.

## Changes

- Add `docs/proxmox-setup.md` with complete setup guide
- Dedicated `TerraformRole` (no Administrator role needed)
- Both Web UI and CLI procedures
- SSH configuration for bpg/proxmox provider

## Privileges (Proxmox 9.1)

| Category  | Privileges |
|-----------|------------|
| Datastore | `Allocate`, `AllocateSpace`, `AllocateTemplate`, `Audit` |
| System    | `Audit`, `Console`, `Modify` |
| VM        | `Allocate`, `Audit`, `Clone`, `Config.*`, `Console`, `Migrate`, `PowerMgmt`, `Snapshot`, `Snapshot.Rollback`, `GuestAgent.Audit`, `GuestAgent.FileRead` |
| Pool      | `Allocate`, `Audit` |
| SDN       | `Use` |

> ⚠️ `VM.Monitor` deprecated in Proxmox 9 — use `VM.GuestAgent.Audit` and `VM.GuestAgent.FileRead` instead.

## Related

Closes #1

Co-authored-by: darnodo <sepales.pret0h@icloud.com>
Reviewed-on: #2
2025-12-07 13:08:16 +00:00