make the pool name a function of the vm name
This commit is contained in:
@@ -3,6 +3,6 @@ resource "libvirt_cloudinit_disk" "commoninit" {
|
|||||||
user_data = templatefile("${path.module}/cloud_init.yaml", {
|
user_data = templatefile("${path.module}/cloud_init.yaml", {
|
||||||
ssh_key = var.ssh_key
|
ssh_key = var.ssh_key
|
||||||
})
|
})
|
||||||
pool = var.pool_name
|
pool = "${var.vm_name}-pool"
|
||||||
depends_on = [libvirt_pool.tf_tmp_storage]
|
depends_on = [libvirt_pool.tf_tmp_storage]
|
||||||
}
|
}
|
@@ -1,5 +1,5 @@
|
|||||||
resource "libvirt_pool" "tf_tmp_storage" {
|
resource "libvirt_pool" "tf_tmp_storage" {
|
||||||
name = var.pool_name
|
name = "${var.vm_name}-pool"
|
||||||
type = "dir"
|
type = "dir"
|
||||||
target {
|
target {
|
||||||
path = var.pool_path
|
path = var.pool_path
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
resource "libvirt_volume" "vm_disk" {
|
resource "libvirt_volume" "vm_disk" {
|
||||||
count = var.instance_count
|
count = var.instance_count
|
||||||
name = "${var.vm_name}-${count.index}"
|
name = "${var.vm_name}-${count.index}"
|
||||||
pool = var.pool_name
|
pool = "${var.vm_name}-pool"
|
||||||
source = var.image_location
|
source = var.image_location
|
||||||
format = "qcow2"
|
format = "qcow2"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user