From 013fc774c090c74b600ee5118ede130d56435d9a Mon Sep 17 00:00:00 2001 From: Pim Kunis Date: Sun, 9 Apr 2023 11:34:30 +0200 Subject: [PATCH] fix dynamic provisioner --- main.tf | 7 ++----- variables.tf | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/main.tf b/main.tf index ea7089c..4be968d 100644 --- a/main.tf +++ b/main.tf @@ -97,11 +97,8 @@ resource "libvirt_domain" "debian" { cloudinit = libvirt_cloudinit_disk.debian.id - dynamic "local-exec" { - for_each = var.ansible_command != "" ? [1] : [] - content { - command = var.ansible_command - } + provisioner "local-exec" { + command = var.ansible_command } lifecycle { diff --git a/variables.tf b/variables.tf index e04cdc8..2c2ce68 100644 --- a/variables.tf +++ b/variables.tf @@ -67,5 +67,5 @@ variable "fixed_address" { variable "ansible_command" { type = string - default = "" + default = "true" }