From 286594939b25f7abb2bb059df3e8b2c7a49bbf0e Mon Sep 17 00:00:00 2001 From: Lukas Greve Date: Sat, 30 Aug 2025 11:19:29 +0200 Subject: [PATCH] allow for the deployment of multiple domains --- .../ubuntu-cloud-server-2404-bios.tf | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ubuntu-cloud-server-2404-bios/ubuntu-cloud-server-2404-bios.tf b/ubuntu-cloud-server-2404-bios/ubuntu-cloud-server-2404-bios.tf index f83d5df..1f25c50 100644 --- a/ubuntu-cloud-server-2404-bios/ubuntu-cloud-server-2404-bios.tf +++ b/ubuntu-cloud-server-2404-bios/ubuntu-cloud-server-2404-bios.tf @@ -20,11 +20,12 @@ resource "libvirt_pool" "ubuntu-bios" { } } -resource "libvirt_volume" "ubuntu-qcow2" { - name = "ubuntu-qcow2" +resource "libvirt_volume" "ubuntu-bios" { + name = "ubuntu-bios-${count.index}" pool = libvirt_pool.ubuntu-bios.name source = "https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img" format = "qcow2" + count = 2 } data "template_file" "user_data" { @@ -38,7 +39,7 @@ resource "libvirt_cloudinit_disk" "commoninit" { } resource "libvirt_domain" "domain" { - count = 1 + count = 2 name = "ubuntu-cloud-server-2404-${count.index}" memory = "4092" vcpu = 2 @@ -49,7 +50,7 @@ resource "libvirt_domain" "domain" { } disk { - volume_id = libvirt_volume.ubuntu-qcow2.id + volume_id = element(libvirt_volume.ubuntu-bios.*.id, count.index) } console {