add ansible provisioner

This commit is contained in:
Pim Kunis 2023-04-09 10:46:17 +02:00
parent 5990d691dd
commit d40da1a9e8
2 changed files with 12 additions and 0 deletions

View file

@ -97,6 +97,13 @@ resource "libvirt_domain" "debian" {
cloudinit = libvirt_cloudinit_disk.debian.id
dynamic "local-exec" {
for_each = var.ansible_command != "" ? [1] : []
content {
command = var.ansible_command
}
}
lifecycle {
replace_triggered_by = [
libvirt_cloudinit_disk.debian.id

View file

@ -64,3 +64,8 @@ variable "fixed_address" {
type = string
default = ""
}
variable "ansible_command" {
type = string
default = ""
}