Fix Pimox template replacement lifecycle
This commit is contained in:
parent
d90ffe5b14
commit
92e5976f1d
|
|
@ -119,21 +119,20 @@ resource "null_resource" "pimox_template_vm_create" {
|
|||
depends_on = [null_resource.provisioning_host]
|
||||
|
||||
triggers = {
|
||||
pimox_host = var.pimox_host
|
||||
pimox_user = var.pimox_user
|
||||
ssh_key_path = var.pimox_ssh_key_path
|
||||
qm_bin = var.pimox_qm_bin
|
||||
builder_version = "5"
|
||||
config_hash = local.config_hash
|
||||
vmid = tostring(var.pimox_template_vmid)
|
||||
name = var.pimox_template_name
|
||||
cores = tostring(var.pimox_template_cores)
|
||||
memory = tostring(var.pimox_template_memory)
|
||||
bridge = var.pimox_template_bridge
|
||||
net0 = local.pimox_template_net0
|
||||
scsi0 = var.pimox_template_scsi0
|
||||
efidisk0 = var.pimox_template_efidisk0
|
||||
replace_existing = tostring(var.pimox_template_replace_existing)
|
||||
pimox_host = var.pimox_host
|
||||
pimox_user = var.pimox_user
|
||||
ssh_key_path = var.pimox_ssh_key_path
|
||||
qm_bin = var.pimox_qm_bin
|
||||
builder_version = "5"
|
||||
config_hash = local.config_hash
|
||||
vmid = tostring(var.pimox_template_vmid)
|
||||
name = var.pimox_template_name
|
||||
cores = tostring(var.pimox_template_cores)
|
||||
memory = tostring(var.pimox_template_memory)
|
||||
bridge = var.pimox_template_bridge
|
||||
net0 = local.pimox_template_net0
|
||||
scsi0 = var.pimox_template_scsi0
|
||||
efidisk0 = var.pimox_template_efidisk0
|
||||
}
|
||||
|
||||
connection {
|
||||
|
|
@ -149,7 +148,7 @@ resource "null_resource" "pimox_template_vm_create" {
|
|||
set -eu
|
||||
|
||||
vmid="${self.triggers.vmid}"
|
||||
replace_existing="${self.triggers.replace_existing}"
|
||||
replace_existing="${var.pimox_template_replace_existing}"
|
||||
qm_cmd="${self.triggers.qm_bin}"
|
||||
|
||||
if [ ! -x "$qm_cmd" ]; then
|
||||
|
|
@ -233,6 +232,7 @@ resource "null_resource" "pimox_template_vm_seal" {
|
|||
guest_user = var.pimox_template_build_user
|
||||
guest_key_path = var.pimox_template_build_ssh_key_path
|
||||
seal_version = "5"
|
||||
create_id = null_resource.pimox_template_vm_create[0].id
|
||||
config_hash = local.config_hash
|
||||
timeout = var.pimox_template_build_timeout
|
||||
timeout_seconds = tostring(var.pimox_template_build_timeout_seconds)
|
||||
|
|
|
|||
Loading…
Reference in New Issue