From bda7120cd988aa7c27c1f26d64dd89f6b2a7c950 Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Wed, 17 Aug 2022 02:16:30 +0200 Subject: [PATCH] Ancora correzioni al template. --- proxmoxve-python/__main__.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/proxmoxve-python/__main__.py b/proxmoxve-python/__main__.py index 43f6f97..fb37d45 100644 --- a/proxmoxve-python/__main__.py +++ b/proxmoxve-python/__main__.py @@ -4,19 +4,20 @@ import pulumi import pulumi_proxmoxve as proxmox config = pulumi.Config() +data = pulumi.require_object("pve") -#provider = proxmox.Provider("proxmoxve", -# virtual_environment = { -# "endpoint": config.require("endpoint"), -# "insecure": True, -# "username": "root@pam", -# "password": config.require_secret("pvepassword") -# } -#) +provider = proxmox.Provider("proxmoxve", + virtual_environment = { + "endpoint": data.get("endpoint"), + "insecure": True, + "username": "root@pam", + "password": data.get_secret("password") + } +) vm = proxmox.vm.VirtualMachine("vm", name = "virtual-machine", - node_name = config.require("node_name"), + node_name = data.get("node_name"), agent = proxmox.vm.VirtualMachineAgentArgs( enabled = True, trim = True, @@ -31,7 +32,7 @@ vm = proxmox.vm.VirtualMachine("vm", dedicated = 2048 ), clone = proxmox.vm.VirtualMachineCloneArgs( - node_name = config.require("node_name"), + node_name = data.require("node_name"), vm_id = config.require("clonevm"), full = True ),