80 Commits

Author SHA1 Message Date
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
e22b8c4aaf Merge pull request 'VM Test' (#8) from deploy_TestVM into dev
All checks were successful
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
darnodo
1baaeffe91 style(terraform): adjust indentation for monitoring VM in prod tfvars
All checks were successful
Terraform CI/CD / Validate (pull_request) Successful in 6s
Terraform CI/CD / Plan (pull_request) Successful in 6s
Terraform CI/CD / Apply (pull_request) Has been skipped
Update the indentation of the `virtual_machines` map in `terraform/prod/terraform.tfvars` from 4 spaces to 2 spaces to maintain consistency with the surrounding HCL code style. No functional changes were made to the configuration values.
2025-12-08 17:20:05 +01:00
darnodo
aa3b32ee53 VM Test
Some checks failed
Terraform CI/CD / Validate (pull_request) Failing after 5s
Terraform CI/CD / Plan (pull_request) Has been skipped
Terraform CI/CD / Apply (pull_request) Has been skipped
2025-12-08 17:16:28 +01:00
bf80e60d7f fix(ci): use head_ref for PR checkout instead of ref_name
All checks were successful
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
darnodo
bb39dfa29e ci: add GIT_TOKEN authentication to checkout steps
All checks were successful
Terraform CI/CD / Validate (push) Successful in 6s
Terraform CI/CD / Plan (push) Successful in 8s
Terraform CI/CD / Apply (push) Has been skipped
The workflow was failing to checkout the repository in certain contexts or was requiring authentication that wasn't previously provided. This change:
- Adds the `GIT_TOKEN` secret to the environment variables.
- Updates the `git clone` commands in the `terraform-plan`, `terraform-apply`, and `terraform-destroy` jobs to include the `${GIT_TOKEN}@` prefix in the clone URL.

This ensures that the workflow can successfully clone the repository even if it's private or requires authenticated access.
2025-12-08 11:56:05 +01:00
darnodo
a02582aaea ci(workflow): hardcode gitea server url in terraform workflow
Some checks failed
Terraform CI/CD / Validate (push) Failing after 2s
Terraform CI/CD / Plan (push) Has been skipped
Terraform CI/CD / Apply (push) Has been skipped
Replaces the dynamic `${{ gitea.server_url }}` variable with the explicit URL `https://gitea.arnodo.fr` in the Terraform workflow configuration. This change affects git clone operations and API calls for posting PR comments, likely to resolve issues with variable expansion or DNS resolution within the runner environment.
2025-12-08 11:31:46 +01:00
darnodo
6efb997684 chore(terraform): update version constraint and allow tfvars
Some checks failed
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 `*.tfvars` from .gitignore to allow tracking variable files.
- Enforce Terraform version to be greater than or equal to 1.5.0 in prod configuration.
2025-12-08 10:22:31 +01:00
ba4b530635 fix(ci): replace actions/checkout with git clone
Some checks failed
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
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
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
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
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
darnodo
531a05a173 docs: fix markdown table alignment in prod README
Reformat the Proxmox template requirements table in `terraform/prod/README.md` to improve readability and ensure consistent spacing between columns. This purely aesthetic change aligns the headers and cell contents properly.
2025-12-07 13:32:03 +01:00
87d357fcb1 Update .gitignore, enhance README formatting, and remove obsolete AWX Kubernetes configurations 2025-10-05 10:51:38 +02:00
darnodo
bc0c9dd450 Add k8s configs and update documentation with AWX setup 2025-08-29 15:05:17 +02:00
darnodo
97b88a7b94 Ajout du submodule awx-operator 2025-08-28 17:23:35 +02:00
D. Arnodo
7e93ff8406 Merge pull request #2 from darnodo/feat/tailscale
Feat/tailscale
2025-07-14 19:40:01 +02:00
darnodo
90b49eee17 Update docs and rename domain suffix
The commit message should be:

``` Translate docs to French and update domain examples

Change the example domain from lab.home.arnodo.fr to taila5ad8.ts.net
and convert documentation to French. Remove LXC container configuration
that was not being used. ```

This message captures the key changes: 1. Translation of documentation
to French 2. Update of domain examples throughout the codebase 3.
Removal of unused LXC container configuration

The changes warrant a body since there are multiple related but distinct
changes being made. The message follows the Git commit style guidelines,
using imperative mood and keeping the first line under 50 characters.
2025-07-03 19:59:02 +02:00
darnodo
7cd93ba978 Add Cloud-Init automation with Tailscale
The commit rephrases the README to focus on Cloud-Init setup and removes
unused Ansible code, making Tailscale configuration automatic.

Subject line: Replace Ansible with automated Cloud-Init configuration

Body: Refactors infrastructure bootstrapping to leverage Cloud-Init
instead of Ansible for initial VM setup, particularly with respect to
Tailscale installation and authentication.

This simplifies the architecture by: - Removing manual post-provisioning
Ansible steps - Automating Tailscale setup via Cloud-Init - Updating
documentation to reflect new workflow
2025-07-03 09:28:09 +02:00
darnodo
26d97cbcfb Improve Grafana Alloy template for metrics and logs handling
Clarify pipelines for Prometheus metrics and Loki logs with better
structure and comments. Fix label for logs from "job" to "unit" and
correct forwarding to Loki destination. Remove duplicate endpoint block.
2025-06-28 20:39:48 +02:00
darnodo
b8df43b209 update behaviors 2025-06-26 19:42:56 +02:00
D. Arnodo
a12ba901a0 Merge pull request #1 from darnodo/geat/logs_exporter
Geat/logs exporter
2025-06-25 19:34:02 +02:00
darnodo
3df6855bb0 ansible(dns): adding alloy configuration 2025-06-25 19:32:38 +02:00
darnodo
23440ad6bd ansible/dns : switch to grafana alloy 2025-06-25 15:33:44 +02:00
darnodo
f4b1ae92c2 ansible : install dnsmasq_exporter 2025-06-21 08:28:10 +02:00
darnodo
64f24ad742 Cleaning VM Creation
- Remove useless tf files
- add extra disks capacity
2025-06-17 20:02:00 +02:00
darnodo
738294875a ansible: remove terraform managed files 2025-06-09 13:50:11 +02:00
darnodo
d71c98c20c ansible: Add example 2025-06-09 13:45:01 +02:00
darnodo
6a00eb2708 first commit 2025-06-09 11:58:11 +02:00