### Global cloud-init template (for all VMs) data "template_file" "cloud_init_global" { template = file("${path.module}/files/cloud_init_global.yaml") vars = { hostname = "generic" domain = "home.arpa" TS_AUTHKEY = var.TS_AUTHKEY SSH_KEY_PUBLIC = var.SSH_KEY_PUBLIC } } resource "local_file" "cloud_init_global" { content = data.template_file.cloud_init_global.rendered filename = "${path.module}/files/cloud_init_global.yaml" } #resource "null_resource" "upload_cloud_init_alpaca" { # count = var.alpaca_vm_count # # connection { # type = "ssh" # user = "root" # private_key = var.ssh_key # host = var.target_node # } # # provisioner "file" { # source = local_file.cloud_init_alpaca[count.index].filename # destination = "/var/lib/vz/snippets/cloud_init_alpaca_${count.index + 1}.yaml" # } #}