summaryrefslogtreecommitdiff
path: root/final/debian.tf
blob: c7dfe515ca831b59fc35f4e20e9fcb9f0cc2fcc9 (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
resource "incus_instance" "debian" {
  name    = "webserver1"
  project = "lamp"
  image   = "images:debian/12/cloud"
  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
  ]
}