42 lines
933 B
Terraform
42 lines
933 B
Terraform
|
|
terraform {
|
||
|
|
required_providers {
|
||
|
|
proxmox = {
|
||
|
|
source = "Telmate/proxmox"
|
||
|
|
version = "2.9.14" # vérifie la dernière version sur GitHub
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
provider "proxmox" {
|
||
|
|
pm_api_url = "https://pve.lawek.com/api2/json"
|
||
|
|
#pm_user = "root@pam"
|
||
|
|
#pm_password = "xxxx"
|
||
|
|
pm_api_token_id = "root@pam!cloud_operator"
|
||
|
|
pm_api_token_secret = "21d623eb-d6c2-4e03-9a28-5c823c643fc4"
|
||
|
|
#pm_tls_insecure = true
|
||
|
|
}
|
||
|
|
|
||
|
|
resource "proxmox_lxc" "test_ct" {
|
||
|
|
hostname = "test-lxc"
|
||
|
|
target_node = "pve3"
|
||
|
|
ostemplate = "cephfs:vztmpl/debian-12-standard_12.7-1_amd64.tar.zst"
|
||
|
|
password = "DebianTest123"
|
||
|
|
cores = 1
|
||
|
|
memory = 512
|
||
|
|
swap = 512
|
||
|
|
unprivileged = true
|
||
|
|
start = true
|
||
|
|
tags = "terraform,test"
|
||
|
|
|
||
|
|
network {
|
||
|
|
name = "eth0"
|
||
|
|
bridge = "vmbr0"
|
||
|
|
ip = "dhcp"
|
||
|
|
gw = ""
|
||
|
|
}
|
||
|
|
|
||
|
|
rootfs {
|
||
|
|
storage = "main-pool"
|
||
|
|
size = "4G"
|
||
|
|
}
|
||
|
|
}
|