shared modules to be used across deployments
This commit is contained in:
33
multiple/shared_modules/domain.tf
Normal file
33
multiple/shared_modules/domain.tf
Normal file
@@ -0,0 +1,33 @@
|
||||
resource "libvirt_domain" "domain" {
|
||||
count = var.instance_count
|
||||
name = "${var.vm_name}-${count.index}"
|
||||
memory = var.memory
|
||||
vcpu = var.vcpu
|
||||
cloudinit = libvirt_cloudinit_disk.commoninit.id
|
||||
cpu {
|
||||
mode = "host-model"
|
||||
}
|
||||
|
||||
disk {
|
||||
volume_id = element(libvirt_volume.vm_disk.*.id, count.index)
|
||||
}
|
||||
|
||||
console {
|
||||
type = "pty"
|
||||
target_port = "0"
|
||||
target_type = "virtio"
|
||||
}
|
||||
|
||||
video {
|
||||
type = "virtio"
|
||||
}
|
||||
|
||||
tpm {
|
||||
backend_type = "emulator"
|
||||
backend_version = "2.0"
|
||||
}
|
||||
|
||||
network_interface {
|
||||
network_name = var.network_name
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user