mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-01-23 05:41:19 -05:00
Add machine variable to terraform module (#179)
* add variable machine to enable/disable secure boot * add role description
This commit is contained in:
parent
b84d8add73
commit
15e668d09b
@ -18,6 +18,7 @@ constellation_coreos_image_qcow2="/path/to/image.qcow2"
|
|||||||
# memory=2048
|
# memory=2048
|
||||||
# state_disk_size=10
|
# state_disk_size=10
|
||||||
# ip_range_start=100
|
# ip_range_start=100
|
||||||
|
# machine="q35"
|
||||||
```
|
```
|
||||||
|
|
||||||
Create terraform resources from within terraform workspace (`terraform/libvirt`):
|
Create terraform resources from within terraform workspace (`terraform/libvirt`):
|
||||||
|
@ -23,6 +23,7 @@ module "control_plane" {
|
|||||||
network_id = libvirt_network.constellation.id
|
network_id = libvirt_network.constellation.id
|
||||||
pool = libvirt_pool.cluster.name
|
pool = libvirt_pool.cluster.name
|
||||||
boot_volume_id = libvirt_volume.constellation_coreos_image.id
|
boot_volume_id = libvirt_volume.constellation_coreos_image.id
|
||||||
|
machine = var.machine
|
||||||
}
|
}
|
||||||
|
|
||||||
module "worker" {
|
module "worker" {
|
||||||
@ -37,6 +38,7 @@ module "worker" {
|
|||||||
network_id = libvirt_network.constellation.id
|
network_id = libvirt_network.constellation.id
|
||||||
pool = libvirt_pool.cluster.name
|
pool = libvirt_pool.cluster.name
|
||||||
boot_volume_id = libvirt_volume.constellation_coreos_image.id
|
boot_volume_id = libvirt_volume.constellation_coreos_image.id
|
||||||
|
machine = var.machine
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "libvirt_pool" "cluster" {
|
resource "libvirt_pool" "cluster" {
|
||||||
|
@ -16,7 +16,7 @@ resource "libvirt_domain" "instance_group" {
|
|||||||
count = var.amount
|
count = var.amount
|
||||||
memory = var.memory
|
memory = var.memory
|
||||||
vcpu = var.vcpus
|
vcpu = var.vcpus
|
||||||
machine = "q35"
|
machine = var.machine
|
||||||
tpm {
|
tpm {
|
||||||
backend_type = "emulator"
|
backend_type = "emulator"
|
||||||
backend_version = "2.0"
|
backend_version = "2.0"
|
||||||
|
@ -44,5 +44,11 @@ variable "boot_volume_id" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
variable "role" {
|
variable "role" {
|
||||||
type = string
|
type = string
|
||||||
|
description = "role of the node in the constellation. either 'control-plane' or 'worker'"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "machine" {
|
||||||
|
type = string
|
||||||
|
description = "machine type. use 'q35' for secure boot and 'pc' for non secure boot. See 'qemu-system-x86_64 -machine help'"
|
||||||
}
|
}
|
||||||
|
@ -38,3 +38,10 @@ variable "ip_range_start" {
|
|||||||
default = 100
|
default = 100
|
||||||
description = "first ip address to use within subnet"
|
description = "first ip address to use within subnet"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
variable "machine" {
|
||||||
|
type = string
|
||||||
|
default = "q35"
|
||||||
|
description = "machine type. use 'q35' for secure boot and 'pc' for non secure boot. See 'qemu-system-x86_64 -machine help'"
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user