add ansible provisioner
This commit is contained in:
parent
5990d691dd
commit
d40da1a9e8
2 changed files with 12 additions and 0 deletions
7
main.tf
7
main.tf
|
@ -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
|
||||
|
|
|
@ -64,3 +64,8 @@ variable "fixed_address" {
|
|||
type = string
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "ansible_command" {
|
||||
type = string
|
||||
default = ""
|
||||
}
|
||||
|
|
Reference in a new issue