split invariants into seperate module
This commit is contained in:
parent
9b70c55033
commit
7aac5730ad
3 changed files with 64 additions and 33 deletions
22
debian/main.tf
vendored
22
debian/main.tf
vendored
|
@ -6,16 +6,20 @@ terraform {
|
|||
}
|
||||
}
|
||||
|
||||
module "invariants" {
|
||||
source = "git::https://git.pim.kunis.nl/home/tf-modules.git/invariants"
|
||||
}
|
||||
|
||||
module "tf_debian_vm" {
|
||||
source = "git::https://git.pim.kunis.nl/pim/tf-debian-vm.git"
|
||||
name = var.name
|
||||
admin_authorized_keys = var.admin_authorized_keys
|
||||
insecure_password = var.insecure_password
|
||||
use_host_cert = var.use_host_cert
|
||||
disk_pool = var.disk_pool
|
||||
disk_base = var.disk_base
|
||||
disk_base_pool = var.disk_base_pool
|
||||
cloudinit_pool = var.cloudinit_pool
|
||||
bridge_name = var.bridge_name
|
||||
ca_host = var.ca_host
|
||||
admin_authorized_keys = coalesce(var.admin_authorized_keys, module.invariants.admin_authorized_keys)
|
||||
insecure_password = coalesce(var.insecure_password, false)
|
||||
use_host_cert = coalesce(var.use_host_cert, true)
|
||||
disk_pool = coalesce(var.disk_pool, module.invariants.disk_pool)
|
||||
disk_base = coalesce(var.disk_base, module.invariants.disk_base)
|
||||
disk_base_pool = coalesce(var.disk_base_pool, module.invariants.disk_base_pool)
|
||||
cloudinit_pool = coalesce(var.cloudinit_pool, module.invariants.cloudinit_pool)
|
||||
bridge_name = coalesce(var.bridge_name, module.invariants.bridge_name)
|
||||
ca_host = coalesce(var.ca_host, module.invariants.ca_host)
|
||||
}
|
||||
|
|
21
debian/variables.tf
vendored
21
debian/variables.tf
vendored
|
@ -4,48 +4,45 @@ variable "name" {
|
|||
|
||||
variable "admin_authorized_keys" {
|
||||
type = list(string)
|
||||
default = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOodpLr+FDRyKyHjucHizNLVFHZ5AQmE9GmxMnOsSoaw pimkunis@thinkpadpim",
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINUZp4BCxf7uLa1QWonx/Crf8tYZ5MKIZ+EuaBa82LrV user@user-laptop"
|
||||
]
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "insecure_password" {
|
||||
type = bool
|
||||
default = false
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "use_host_cert" {
|
||||
type = bool
|
||||
default = true
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "disk_pool" {
|
||||
type = string
|
||||
default = "disk"
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "disk_base" {
|
||||
type = string
|
||||
default = "debian-bookworm.qcow2"
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "disk_base_pool" {
|
||||
type = string
|
||||
default = "iso"
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "cloudinit_pool" {
|
||||
type = string
|
||||
default = "init"
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "bridge_name" {
|
||||
type = string
|
||||
default = "dmzbr"
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "ca_host" {
|
||||
type = string
|
||||
default = "hermes.dmz"
|
||||
default = null
|
||||
}
|
||||
|
|
30
invariants/outputs.tf
Normal file
30
invariants/outputs.tf
Normal file
|
@ -0,0 +1,30 @@
|
|||
output "admin_authorized_keys" {
|
||||
value = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOodpLr+FDRyKyHjucHizNLVFHZ5AQmE9GmxMnOsSoaw pimkunis@thinkpadpim",
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINUZp4BCxf7uLa1QWonx/Crf8tYZ5MKIZ+EuaBa82LrV user@user-laptop"
|
||||
]
|
||||
}
|
||||
|
||||
output "disk_pool" {
|
||||
value = "disk"
|
||||
}
|
||||
|
||||
output "disk_base" {
|
||||
value = "debian-bookworm.qcow2"
|
||||
}
|
||||
|
||||
output "disk_base_pool" {
|
||||
value = "iso"
|
||||
}
|
||||
|
||||
output "cloudinit_pool" {
|
||||
value = "init"
|
||||
}
|
||||
|
||||
output "bridge_name" {
|
||||
value = "dmzbr"
|
||||
}
|
||||
|
||||
output "ca_host" {
|
||||
value = "hermes.dmz"
|
||||
}
|
Reference in a new issue