resource "incus_instance" "instance" { for_each = var.containers name = "${each.key}" project = "lamp" image = "images:${each.value.image}" wait_for { type = "ipv4" } provisioner "local-exec" { command = "./local_script ${self.ipv4_address} ${self.name}" } connection { type = "ssh" host = self.ipv4_address user = "ansible" private_key = file("~/.ssh/id_rsa") } provisioner "remote-exec" { inline = [ "cloud-init status || true" ] } depends_on = [ incus_profile.lamp ] }