allow for the deployment of multiple domains
This commit is contained in:
@@ -20,11 +20,12 @@ resource "libvirt_pool" "ubuntu-bios" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "libvirt_volume" "ubuntu-qcow2" {
|
resource "libvirt_volume" "ubuntu-bios" {
|
||||||
name = "ubuntu-qcow2"
|
name = "ubuntu-bios-${count.index}"
|
||||||
pool = libvirt_pool.ubuntu-bios.name
|
pool = libvirt_pool.ubuntu-bios.name
|
||||||
source = "https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img"
|
source = "https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img"
|
||||||
format = "qcow2"
|
format = "qcow2"
|
||||||
|
count = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
data "template_file" "user_data" {
|
data "template_file" "user_data" {
|
||||||
@@ -38,7 +39,7 @@ resource "libvirt_cloudinit_disk" "commoninit" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resource "libvirt_domain" "domain" {
|
resource "libvirt_domain" "domain" {
|
||||||
count = 1
|
count = 2
|
||||||
name = "ubuntu-cloud-server-2404-${count.index}"
|
name = "ubuntu-cloud-server-2404-${count.index}"
|
||||||
memory = "4092"
|
memory = "4092"
|
||||||
vcpu = 2
|
vcpu = 2
|
||||||
@@ -49,7 +50,7 @@ resource "libvirt_domain" "domain" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
disk {
|
disk {
|
||||||
volume_id = libvirt_volume.ubuntu-qcow2.id
|
volume_id = element(libvirt_volume.ubuntu-bios.*.id, count.index)
|
||||||
}
|
}
|
||||||
|
|
||||||
console {
|
console {
|
||||||
|
Reference in New Issue
Block a user