feat(lawndale-vm): options for machine type and firmware
Some checks reported errors
continuous-integration/drone/push Build encountered an error

This commit is contained in:
2022-11-27 22:01:32 +01:00
parent 63c270e896
commit 7a40f2db5b
3 changed files with 36 additions and 1 deletions

View File

@@ -40,6 +40,9 @@ resource "libvirt_domain" "this" {
cloudinit = libvirt_cloudinit_disk.this.id
firmware = var.uefi ? "/usr/share/edk2-ovmf/OVMF_CODE.fd" : null
machine = var.machine
network_interface {
bridge = module.ipam.lawndale_interface
mac = macaddress.this.address
@@ -95,6 +98,7 @@ locals {
match = {
macaddress = macaddress.this.address
}
"set-name" = "eth"
addresses = [
"${module.ipam.ip_address}/${module.ipam.cidr}"
]

View File

@@ -0,0 +1,19 @@
output "macaddress" {
value = macaddress.this.address
}
output "_pool" {
value = var.create_root_storage_pool ? libvirt_pool.this : null
}
output "_disk" {
value = libvirt_volume.this
}
output "_domain" {
value = libvirt_domain.this
}
output "ipam" {
value = module.ipam
}

View File

@@ -19,6 +19,18 @@ variable "vcpu" {
default = 1
}
variable "uefi" {
type = bool
description = "Whether or not to create an UEFI domain"
default = false
}
variable "machine" {
type = string
description = "The machine type - can be i440fx (default) or q35. PCIe support requires Q35 (or better)"
default = null
}
variable "memory_mb" {
type = number
description = "VM memory allocation in megabytes"