Initialisation de la structure Infra-Lab
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
proxmox = {
|
||||
source = "telmate/proxmox"
|
||||
version = "2.9.14"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
provider "proxmox" {
|
||||
pm_api_url = "https://192.168.76.43:8006/api2/json"
|
||||
pm_api_token_id = "root@pam!terraform"
|
||||
pm_api_token_secret = "TON_SECRET_ICI"
|
||||
pm_tls_insecure = true
|
||||
}
|
||||
|
||||
resource "proxmox_vm_qemu" "docker_nodes" {
|
||||
count = 2 # On déploie 2 VMs d'un coup !
|
||||
name = "srv-docker-${count.index + 1}"
|
||||
target_node = "PVE00" # Ton HP Gen 10+ avec le RAID 10
|
||||
clone = "debian13-cloudinit-template"
|
||||
|
||||
# Configuration CPU/RAM
|
||||
cores = 2
|
||||
memory = 4096
|
||||
agent = 1 # Active le QEMU Guest Agent
|
||||
|
||||
# Réseau : VLAN 530 (Docker)
|
||||
network {
|
||||
model = "virtio"
|
||||
bridge = "vmbr1"
|
||||
tag = 530
|
||||
}
|
||||
|
||||
# Cloud-Init : IPs statiques automatiques
|
||||
ipconfig0 = "ip=192.168.30.2${count.index}/24,gw=192.168.30.254"
|
||||
|
||||
# Injecte ta clé SSH pour qu'Ansible puisse se connecter après
|
||||
sshkeys = <<EOF
|
||||
ssh-rsa AAAAB3Nza... ton_adresse@mail.com
|
||||
EOF
|
||||
}
|
||||
Reference in New Issue
Block a user