From 5189398f8dec82f9f36566190e8cb273c974392d Mon Sep 17 00:00:00 2001 From: darnodo Date: Mon, 8 Dec 2025 09:55:43 +0100 Subject: [PATCH] chore: allow tfvars and set min terraform version - Update .gitignore to remove `*.tfvars` exclusion, allowing variable definition files to be tracked in version control. - Enforce a minimum Terraform version of 1.5.0 in `terraform/prod/providers.tf` to ensure compatibility with modern features. --- .gitignore | 1 - terraform/prod/providers.tf | 2 ++ terraform/prod/terraform.tfvars | 63 +++++++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 terraform/prod/terraform.tfvars diff --git a/.gitignore b/.gitignore index 00057d1..6d473cb 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ .terraform/ *.tfstate *.tfstate.* -*.tfvars # Fichiers sensibles d'Ansible *.vault diff --git a/terraform/prod/providers.tf b/terraform/prod/providers.tf index f1bf1f7..4b72ffc 100644 --- a/terraform/prod/providers.tf +++ b/terraform/prod/providers.tf @@ -7,6 +7,8 @@ # ===================================================================== terraform { + required_version = ">= 1.5.0" + # --------------------------------------------------------------------------- # Backend S3 - Stockage distant du state Terraform # diff --git a/terraform/prod/terraform.tfvars b/terraform/prod/terraform.tfvars new file mode 100644 index 0000000..d7577fa --- /dev/null +++ b/terraform/prod/terraform.tfvars @@ -0,0 +1,63 @@ +# terraform.tfvars.example +# Fichier d'exemple pour la configuration Terraform du homelab +# +# Instructions : +# 1. Copiez ce fichier vers terraform.tfvars +# 2. Personnalisez les valeurs selon votre environnement +# 3. Le fichier terraform.tfvars est ignoré par Git pour la sécurité + +############################# +# Configuration Proxmox +############################# + +# URL de votre serveur Proxmox (REQUIS) +proxmox_url = "https://pve01.taila5ad8.ts.net:8006" + +# Nœud Proxmox cible (défaut: pve01) +target_node = "pve01" + +############################# +# Configuration réseau +############################# + +# Suffixe de domaine pour les VMs +domain_suffix = "taila5ad8.ts.net" + +############################# +# Configuration SSH +############################# + +# Chemin vers votre clé SSH publique +admin_ssh_public_key_path = "~/.ssh/keys/id_rsa.pub" + +# Utilisateur par défaut sur les VMs +default_vm_user = "damien" + +virtual_machines = { + "monitoring" = { + os = "debian" + cores = 2 + memory = 4096 + disk_gb = 30 + ip = "192.168.1.161" + gateway = "192.168.1.254" + tags = ["monitoring"] + } +} + +############################# +# Notes de configuration +############################# + +# Templates requis sur Proxmox : +# - Template Ubuntu avec tags : ["ubuntu", "template"] +# - Template Debian avec tags : ["debian", "template"] +# - Template Alpine avec tags : ["alpine", "template"] +# - Template Rocky avec tags : ["rocky", "template"] +# - Template CentOS avec tags : ["centos", "template"] + +# Ressources recommandées par type de service : +# - Monitoring : 2 CPU, 4GB RAM, 30GB disque +# - Web server : 2 CPU, 2GB RAM, 20GB disque +# - Database : 4+ CPU, 8GB+ RAM, 50GB+ disque +# - Kubernetes : 4+ CPU, 4GB+ RAM, 40GB+ disque