summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjerome <jerome@xlinfo.fr>2025-01-29 23:19:44 +0100
committerjerome <jerome@xlinfo.fr>2025-01-29 23:19:44 +0100
commit8ec98cb82131bbee91b872f5cf2ade0b2b3cc882 (patch)
treea2f733b35b2298380029c3d0bd08b4200b1f7c66
parenta6af2236963c1786e851ec431386680a66ecf89b (diff)
downloadproxmox_vm-8ec98cb82131bbee91b872f5cf2ade0b2b3cc882.tar.gz
proxmox_vm-8ec98cb82131bbee91b872f5cf2ade0b2b3cc882.zip
variables
-rw-r--r--main.tf16
-rw-r--r--ubuntu_planbin0 -> 5255 bytes
-rw-r--r--variables.tf21
3 files changed, 29 insertions, 8 deletions
diff --git a/main.tf b/main.tf
index 6811051..48c4c08 100644
--- a/main.tf
+++ b/main.tf
@@ -9,19 +9,19 @@ terraform {
provider "proxmox" {
pm_api_url = "https://pve.xlinfo.fr:8006/api2/json"
- pm_user = "xxxxxxxx@pve"
- pm_password = "xxxxxxxx"
+ pm_user = "stagiaire@pve"
+ pm_password = "terraform"
}
resource "proxmox_vm_qemu" "stagiaire" {
- vmid = 201
- name = "ubuntu-prenom"
- target_node = "pve"
- clone = "ubuntu-cloud"
+ vmid = var.vmid
+ name = "${var.distribution}-${var.prenom}"
+ clone = var.image
- agent = 1
- os_type = "cloud-init"
+ target_node = "pve"
+ os_type = "cloud-init"
+ agent = 1
cores = 1
sockets = 1
cpu_type = "host"
diff --git a/ubuntu_plan b/ubuntu_plan
new file mode 100644
index 0000000..f5fe908
--- /dev/null
+++ b/ubuntu_plan
Binary files differ
diff --git a/variables.tf b/variables.tf
new file mode 100644
index 0000000..ad54ea9
--- /dev/null
+++ b/variables.tf
@@ -0,0 +1,21 @@
+# variables
+
+variable "vmid" {
+ description = "id de la machine"
+ type = number
+}
+
+variable "prenom" {
+ description = "prenom"
+ type = string
+}
+
+variable "image" {
+ description = "source de l'image disque"
+ type = string
+}
+
+variable "distribution" {
+ description = "distribution"
+ type = string
+}