data "template_file" "user_data" { template = "${file("${path.module}/cloud_init_user_data.yml")}" vars = { hostname = var.hostname } } data "template_file" "meta_data" { template = "${file("${path.module}/cloud_init_meta_data.yml")}" vars = { dns_address = var.dns_address dns_domain = var.dns_domain } } # Use CloudInit to add the instance resource "libvirt_cloudinit_disk" "commoninit" { name = "commoninit.iso" pool = var.pool_1 user_data = data.template_file.user_data.rendered meta_data = data.template_file.meta_data.rendered }