From 65ae07a224af9ccec066ea4f6bed826ee45641f8 Mon Sep 17 00:00:00 2001 From: jerome Date: Fri, 29 Aug 2025 11:09:17 +0200 Subject: ansible --- tofu/ansible/main.tf | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'tofu/ansible/main.tf') 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" + ] + } +} -- cgit v1.2.3