Format OpenTofu configuration
This commit is contained in:
parent
e879899d90
commit
abb30623d0
|
|
@ -38,8 +38,8 @@ locals {
|
|||
target = { kind = "Deployment", name = "local-registry" }
|
||||
patch = yamlencode([
|
||||
{
|
||||
op = "replace"
|
||||
path = "/spec/template/spec/affinity/nodeAffinity/requiredDuringSchedulingIgnoredDuringExecution/nodeSelectorTerms/0/matchExpressions/0/values"
|
||||
op = "replace"
|
||||
path = "/spec/template/spec/affinity/nodeAffinity/requiredDuringSchedulingIgnoredDuringExecution/nodeSelectorTerms/0/matchExpressions/0/values"
|
||||
value = [var.registry_placement.node]
|
||||
},
|
||||
])
|
||||
|
|
@ -49,8 +49,8 @@ locals {
|
|||
patch = yamlencode([
|
||||
{ op = "replace", path = "/spec/local/path", value = var.registry_placement.path },
|
||||
{
|
||||
op = "replace"
|
||||
path = "/spec/nodeAffinity/required/nodeSelectorTerms/0/matchExpressions/0/values"
|
||||
op = "replace"
|
||||
path = "/spec/nodeAffinity/required/nodeSelectorTerms/0/matchExpressions/0/values"
|
||||
value = [var.registry_placement.node]
|
||||
},
|
||||
])
|
||||
|
|
|
|||
|
|
@ -16,26 +16,26 @@ terraform {
|
|||
resource "null_resource" "k3s_control_plane" {
|
||||
count = local.k3s_enabled ? 1 : 0
|
||||
triggers = {
|
||||
node_name = var.control_plane_node_name
|
||||
host = var.control_plane_host
|
||||
user = var.control_plane_user
|
||||
ssh_key_path = var.control_plane_ssh_key_path
|
||||
advertise_address = var.control_plane_advertise_address
|
||||
kubeconfig_path = var.kubeconfig_path
|
||||
kubeconfig_owner = var.kubeconfig_owner
|
||||
k3s_version = var.k3s_version
|
||||
allow_hypervisor_host = var.k3s_allow_hypervisor_host
|
||||
runtime_storage_path = var.k3s_runtime_storage_path
|
||||
required_data_mount = var.k3s_required_data_mount
|
||||
node_name = var.control_plane_node_name
|
||||
host = var.control_plane_host
|
||||
user = var.control_plane_user
|
||||
ssh_key_path = var.control_plane_ssh_key_path
|
||||
advertise_address = var.control_plane_advertise_address
|
||||
kubeconfig_path = var.kubeconfig_path
|
||||
kubeconfig_owner = var.kubeconfig_owner
|
||||
k3s_version = var.k3s_version
|
||||
allow_hypervisor_host = var.k3s_allow_hypervisor_host
|
||||
runtime_storage_path = var.k3s_runtime_storage_path
|
||||
required_data_mount = var.k3s_required_data_mount
|
||||
runtime_storage_helper = filesha256("${path.module}/../../scripts/k3s-runtime-storage-host.py")
|
||||
pod_network_cidr = var.pod_network_cidr
|
||||
pod_network_cidr = var.pod_network_cidr
|
||||
}
|
||||
connection {
|
||||
type = "ssh"
|
||||
user = self.triggers.user
|
||||
type = "ssh"
|
||||
user = self.triggers.user
|
||||
private_key = file(self.triggers.ssh_key_path)
|
||||
host = self.triggers.host
|
||||
timeout = "30m"
|
||||
host = self.triggers.host
|
||||
timeout = "30m"
|
||||
}
|
||||
provisioner "remote-exec" {
|
||||
inline = [<<EOT
|
||||
|
|
@ -85,20 +85,20 @@ EOT
|
|||
}
|
||||
|
||||
resource "null_resource" "k3s_kubeconfig" {
|
||||
count = local.k3s_enabled ? 1 : 0
|
||||
count = local.k3s_enabled ? 1 : 0
|
||||
depends_on = [null_resource.k3s_control_plane]
|
||||
triggers = {
|
||||
control_plane_id = null_resource.k3s_control_plane[0].id
|
||||
host = var.control_plane_host
|
||||
user = var.control_plane_user
|
||||
ssh_key_path = var.control_plane_ssh_key_path
|
||||
control_plane_id = null_resource.k3s_control_plane[0].id
|
||||
host = var.control_plane_host
|
||||
user = var.control_plane_user
|
||||
ssh_key_path = var.control_plane_ssh_key_path
|
||||
advertise_address = var.control_plane_advertise_address
|
||||
kubeconfig_path = var.kubeconfig_path
|
||||
kubeconfig_owner = var.kubeconfig_owner
|
||||
kubeconfig_path = var.kubeconfig_path
|
||||
kubeconfig_owner = var.kubeconfig_owner
|
||||
}
|
||||
provisioner "local-exec" {
|
||||
interpreter = ["/bin/bash", "-lc"]
|
||||
command = <<EOT
|
||||
command = <<EOT
|
||||
set -euo pipefail
|
||||
tmp_file="$(mktemp)"
|
||||
trap 'rm -f "$tmp_file"' EXIT
|
||||
|
|
@ -1662,7 +1662,7 @@ locals {
|
|||
control_plane_node_label_pairs = [
|
||||
for label, value in merge(var.control_plane_node_labels,
|
||||
length(var.worker_nodes) == 0 ? { "homelab.dev/workload-class" = "platform" } : {}
|
||||
) : {
|
||||
) : {
|
||||
node_name = var.control_plane_node_name
|
||||
label = label
|
||||
value = value
|
||||
|
|
|
|||
|
|
@ -93,45 +93,45 @@ locals {
|
|||
|
||||
resource "null_resource" "edge_services" {
|
||||
triggers = {
|
||||
instance_id = var.edge_instance_id
|
||||
host = var.edge_host
|
||||
user = var.edge_user
|
||||
install_dir = var.edge_install_dir
|
||||
install_docker = tostring(var.edge_install_docker)
|
||||
server_name = var.server_name
|
||||
server_names = join(" ", local.server_names)
|
||||
certbot_domain_args = join(" ", [for name in local.server_names : "-d ${name}"])
|
||||
backend_host = var.backend_host
|
||||
backend_port = tostring(var.backend_port)
|
||||
gitea_backend_host = var.gitea_backend_host
|
||||
gitea_backend_port = tostring(var.gitea_backend_port)
|
||||
heimdall_host = local.heimdall_backend_host
|
||||
heimdall_port = tostring(var.heimdall_backend_port)
|
||||
oidc_host = local.oidc_backend_host
|
||||
oidc_port = tostring(var.oidc_backend_port)
|
||||
jellyfin_host = local.jellyfin_backend_host
|
||||
jellyfin_port = tostring(var.jellyfin_backend_port)
|
||||
jeannie_api_host = var.jeannie_api_backend_host
|
||||
jeannie_api_port = tostring(var.jeannie_api_backend_port)
|
||||
office_host = var.office_backend_host
|
||||
office_port = tostring(var.office_backend_port)
|
||||
matrix_server_name = var.matrix_server_name
|
||||
element_server_name = var.element_server_name
|
||||
matrix_enabled = tostring(var.matrix_enabled)
|
||||
instance_id = var.edge_instance_id
|
||||
host = var.edge_host
|
||||
user = var.edge_user
|
||||
install_dir = var.edge_install_dir
|
||||
install_docker = tostring(var.edge_install_docker)
|
||||
server_name = var.server_name
|
||||
server_names = join(" ", local.server_names)
|
||||
certbot_domain_args = join(" ", [for name in local.server_names : "-d ${name}"])
|
||||
backend_host = var.backend_host
|
||||
backend_port = tostring(var.backend_port)
|
||||
gitea_backend_host = var.gitea_backend_host
|
||||
gitea_backend_port = tostring(var.gitea_backend_port)
|
||||
heimdall_host = local.heimdall_backend_host
|
||||
heimdall_port = tostring(var.heimdall_backend_port)
|
||||
oidc_host = local.oidc_backend_host
|
||||
oidc_port = tostring(var.oidc_backend_port)
|
||||
jellyfin_host = local.jellyfin_backend_host
|
||||
jellyfin_port = tostring(var.jellyfin_backend_port)
|
||||
jeannie_api_host = var.jeannie_api_backend_host
|
||||
jeannie_api_port = tostring(var.jeannie_api_backend_port)
|
||||
office_host = var.office_backend_host
|
||||
office_port = tostring(var.office_backend_port)
|
||||
matrix_server_name = var.matrix_server_name
|
||||
element_server_name = var.element_server_name
|
||||
matrix_enabled = tostring(var.matrix_enabled)
|
||||
certificate_sync_revision = "matrix-san-v1"
|
||||
enable_letsencrypt = tostring(var.enable_letsencrypt)
|
||||
letsencrypt_email = var.letsencrypt_email
|
||||
letsencrypt_staging = tostring(var.letsencrypt_staging)
|
||||
certbot_version = "2"
|
||||
lab_schedule_enabled = tostring(var.lab_schedule_enabled)
|
||||
lab_schedule_api_url = var.lab_schedule_api_url
|
||||
lab_schedule_timezone = var.lab_schedule_timezone
|
||||
enable_letsencrypt = tostring(var.enable_letsencrypt)
|
||||
letsencrypt_email = var.letsencrypt_email
|
||||
letsencrypt_staging = tostring(var.letsencrypt_staging)
|
||||
certbot_version = "2"
|
||||
lab_schedule_enabled = tostring(var.lab_schedule_enabled)
|
||||
lab_schedule_api_url = var.lab_schedule_api_url
|
||||
lab_schedule_timezone = var.lab_schedule_timezone
|
||||
agent_watchdog_hash = sha256(join("", [
|
||||
filesha256("${path.module}/files/oracle-agent-watchdog.sh"),
|
||||
filesha256("${path.module}/files/oracle-agent-watchdog.service"),
|
||||
filesha256("${path.module}/files/oracle-agent-watchdog.timer"),
|
||||
]))
|
||||
config_hash = local.config_hash
|
||||
config_hash = local.config_hash
|
||||
}
|
||||
|
||||
connection {
|
||||
|
|
|
|||
|
|
@ -129,10 +129,10 @@ resource "null_resource" "pimox_template_vm_create" {
|
|||
depends_on = [null_resource.provisioning_host]
|
||||
|
||||
triggers = {
|
||||
pimox_host = var.pimox_host
|
||||
pimox_user = var.pimox_user
|
||||
ssh_key_path = var.pimox_ssh_key_path
|
||||
qm_bin = var.pimox_qm_bin
|
||||
pimox_host = var.pimox_host
|
||||
pimox_user = var.pimox_user
|
||||
ssh_key_path = var.pimox_ssh_key_path
|
||||
qm_bin = var.pimox_qm_bin
|
||||
builder_version = "7"
|
||||
config_hash = local.config_hash
|
||||
replace_existing = tostring(var.pimox_template_replace_existing)
|
||||
|
|
|
|||
Loading…
Reference in New Issue