blob: 99c97f5973bb2c809f6307a2efe0d473cd1780c2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
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
]
}
|