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 cloudinit = libvirt_cloudinit_disk.this.id
firmware = var.uefi ? "/usr/share/edk2-ovmf/OVMF_CODE.fd" : null
machine = var.machine
network_interface { network_interface {
bridge = module.ipam.lawndale_interface bridge = module.ipam.lawndale_interface
mac = macaddress.this.address mac = macaddress.this.address
@@ -95,6 +98,7 @@ locals {
match = { match = {
macaddress = macaddress.this.address macaddress = macaddress.this.address
} }
"set-name" = "eth"
addresses = [ addresses = [
"${module.ipam.ip_address}/${module.ipam.cidr}" "${module.ipam.ip_address}/${module.ipam.cidr}"
] ]
@@ -116,4 +120,4 @@ EOM
meta_data = var.meta_data != null ? var.meta_data : local.default_meta_data meta_data = var.meta_data != null ? var.meta_data : local.default_meta_data
network_config = var.network_config != null ? var.network_config : jsonencode(local.default_network_config) network_config = var.network_config != null ? var.network_config : jsonencode(local.default_network_config)
} }

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 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" { variable "memory_mb" {
type = number type = number
description = "VM memory allocation in megabytes" description = "VM memory allocation in megabytes"