From fcbf4a9781df499a48a3199df407f182212d91ca Mon Sep 17 00:00:00 2001 From: jerome Date: Mon, 12 Jun 2023 13:28:55 +0200 Subject: commit original --- main.tf | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 main.tf (limited to 'main.tf') diff --git a/main.tf b/main.tf new file mode 100644 index 0000000..7a29dd1 --- /dev/null +++ b/main.tf @@ -0,0 +1,39 @@ +terraform { + required_providers { + proxmox = { + source = "telmate/proxmox" + version = ">=2.0.0" + } + } +} + +provider "proxmox" { + # Configuration options + #pm_tls_insecure = true + pm_api_url = "https://pve.xlinfo.fr:8006/api2/json" + #pm_user = "root@pam" + #pm_password = "secret" + pm_api_token_id = "root@pam!terraform" + pm_api_token_secret = "a60b267c-5211-4090-bffd-12178f120840" +} + +resource "proxmox_lxc" "basic" { + target_node = "pve" + hostname = "alpine" + ostemplate = "local:vztmpl/alpine-3.17-default_20221129_amd64.tar.xz" + password = "secret" + unprivileged = true + start = true + + // Terraform will crash without rootfs defined + rootfs { + storage = "local-lvm" + size = "8G" + } + + network { + name = "eth0" + bridge = "vmbr0" + ip = "dhcp" + } +} -- cgit v1.2.3