Make enabling cloud_init optionnal
For cloud images that needs it, cloud_init can be enabled in the main.tf file. This change will allow deployments that does not require cloud_init to be supported
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
# Only create the cloudinit disk if enabled
|
||||
resource "libvirt_cloudinit_disk" "commoninit" {
|
||||
name = var.cloudinit_filename
|
||||
count = var.enable_cloudinit ? var.instance_count : 0
|
||||
|
||||
name = "${var.cloudinit_filename}-${count.index}"
|
||||
user_data = templatefile("${path.module}/cloud_init.yaml", {
|
||||
ssh_key = var.ssh_key
|
||||
})
|
||||
pool = "${var.vm_name}-pool"
|
||||
pool = "${var.vm_name}-pool"
|
||||
depends_on = [libvirt_pool.tf_tmp_storage]
|
||||
}
|
Reference in New Issue
Block a user