## 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
76 lines
2.0 KiB
HCL
76 lines
2.0 KiB
HCL
# Fichier: terraform/environments/prod/variables.tf
|
|
|
|
variable "target_node" {
|
|
description = "Le nom du noeud Proxmox sur lequel déployer les VMs."
|
|
type = string
|
|
default = "pve01"
|
|
}
|
|
|
|
variable "proxmox_url" {
|
|
description = "URL du noeud Proxmox sur lequel déployer les VMs."
|
|
type = string
|
|
}
|
|
|
|
variable "proxmox_api_token" {
|
|
description = "Token pour accéder à l'API Proxmox"
|
|
type = string
|
|
sensitive = true
|
|
}
|
|
|
|
variable "tailscale_auth_key" {
|
|
description = "Clé d'authentification Tailscale pour enregistrer les noeuds."
|
|
type = string
|
|
sensitive = true
|
|
}
|
|
|
|
variable "admin_ssh_public_key_path" {
|
|
description = "Chemin vers le fichier de la clé SSH publique à autoriser."
|
|
type = string
|
|
default = "~/.ssh/id_rsa.pub"
|
|
}
|
|
|
|
variable "domain_suffix" {
|
|
description = "Suffixe de domaine pour les VMs (ex: taila5ad8.ts.net)"
|
|
type = string
|
|
default = "taila5ad8.ts.net"
|
|
}
|
|
|
|
variable "default_vm_user" {
|
|
description = "Utilisateur par défaut pour les VMs"
|
|
type = string
|
|
default = "root"
|
|
}
|
|
|
|
variable "virtual_machines" {
|
|
description = "Configuration des machines virtuelles à déployer"
|
|
type = map(object({
|
|
# Configuration de base
|
|
os = string
|
|
cores = number
|
|
memory = number
|
|
disk_gb = number
|
|
ip = string
|
|
gateway = string
|
|
|
|
# Configuration optionnelle
|
|
cpu_type = optional(string, "host")
|
|
netmask = optional(string, "24")
|
|
datastore = optional(string, "local-lvm")
|
|
disk_format = optional(string, "raw")
|
|
network_bridge = optional(string, "vmbr0")
|
|
network_model = optional(string, "virtio")
|
|
username = optional(string, "damien")
|
|
on_boot = optional(bool, true)
|
|
tags = optional(list(string), [])
|
|
|
|
# Disques supplémentaires (optionnel)
|
|
additional_disks = optional(list(object({
|
|
interface = string
|
|
datastore = string
|
|
size = number
|
|
format = optional(string, "raw")
|
|
})), [])
|
|
}))
|
|
default = {}
|
|
}
|