diff options
| author | jerome <jerome@xlinfo.fr> | 2025-08-29 15:44:31 +0200 |
|---|---|---|
| committer | jerome <jerome@xlinfo.fr> | 2025-08-29 15:44:31 +0200 |
| commit | 724ac3e34834c62a4875df8ae5b9deda4f90d6c2 (patch) | |
| tree | ec29c272f7b8f930bd28ff176077b0c3cbc00b0f /final/container.tf | |
| parent | 65ae07a224af9ccec066ea4f6bed826ee45641f8 (diff) | |
| download | incus-master.tar.gz incus-master.zip | |
Diffstat (limited to 'final/container.tf')
| -rw-r--r-- | final/container.tf | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/final/container.tf b/final/container.tf new file mode 100644 index 0000000..99c97f5 --- /dev/null +++ b/final/container.tf @@ -0,0 +1,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 + ] +} |
