diff options
Diffstat (limited to 'tofu/ansible/main.tf')
| -rw-r--r-- | tofu/ansible/main.tf | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/tofu/ansible/main.tf b/tofu/ansible/main.tf index 986775a..d491a93 100644 --- a/tofu/ansible/main.tf +++ b/tofu/ansible/main.tf @@ -12,7 +12,7 @@ provider "incus" { } resource "incus_instance" "debian" { - name = "webserver1" + name = "debian" project = "lab" image = "images:debian/12/cloud" wait_for { @@ -35,7 +35,7 @@ resource "incus_instance" "debian" { } resource "incus_instance" "rocky" { - name = "webserver2" + name = "rocky" project = "lab" image = "images:rockylinux/9/cloud" wait_for { @@ -57,3 +57,25 @@ resource "incus_instance" "rocky" { } } +resource "incus_instance" "ubuntu" { + name = "ubuntu" + project = "lab" + image = "images:rockylinux/9/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" + ] + } +} |
