mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
feat(prox): reisen node config
This commit is contained in:
parent
3053ec927c
commit
bdc353964d
7 changed files with 116 additions and 26 deletions
|
|
@ -11,24 +11,28 @@ locals {
|
|||
port = var.proxmox_reisen_ssh_port
|
||||
}
|
||||
|
||||
proxmox_reisen_sysctl_net = file("${path.root}/../systems/reisen/sysctl.50-net.conf")
|
||||
proxmox_reisen_net_vmbr0_ipv6 = file("${path.root}/../systems/reisen/net.50-vmbr0-ipv6.conf")
|
||||
proxmox_reisen_udev_dri = file("${path.root}/../systems/reisen/udev.90-dri.rules")
|
||||
proxmox_reisen_udev_z2m = file("${path.root}/../systems/reisen/udev.90-z2m.rules")
|
||||
|
||||
proxmox_reisen_users = jsondecode(file("${path.root}/../systems/reisen/users.json"))
|
||||
proxmox_reisen_systems = jsondecode(file("${path.root}/../systems/reisen/systems.json"))
|
||||
proxmox_reisen_extern = jsondecode(file("${path.root}/../systems/reisen/extern.json"))
|
||||
|
||||
proxmox_reisen_files = [
|
||||
for dest, file in local.proxmox_reisen_extern.files : merge(
|
||||
file,
|
||||
{
|
||||
dest = dest
|
||||
path = "${path.root}/../${file.source}"
|
||||
}
|
||||
)
|
||||
]
|
||||
|
||||
systems = jsondecode(file("${path.root}/../ci/systems.json"))
|
||||
}
|
||||
|
||||
resource "terraform_data" "proxmox_reisen_etc" {
|
||||
triggers_replace = [
|
||||
local.proxmox_reisen_sysctl_net,
|
||||
local.proxmox_reisen_net_vmbr0_ipv6,
|
||||
local.proxmox_reisen_udev_dri,
|
||||
local.proxmox_reisen_udev_z2m,
|
||||
]
|
||||
triggers_replace = [for file in local.proxmox_reisen_files : {
|
||||
dest = file.dest
|
||||
sh256 = filesha256(file.path)
|
||||
}]
|
||||
|
||||
connection {
|
||||
type = local.proxmox_reisen_connection.type
|
||||
|
|
@ -39,12 +43,7 @@ resource "terraform_data" "proxmox_reisen_etc" {
|
|||
}
|
||||
|
||||
provisioner "remote-exec" {
|
||||
inline = [
|
||||
"putfile64 /etc/network/interfaces.d/50-vmbr0-ipv6.conf ${base64encode(local.proxmox_reisen_net_vmbr0_ipv6)}",
|
||||
"putfile64 /etc/sysctl.d/50-net.conf ${base64encode(local.proxmox_reisen_sysctl_net)}",
|
||||
"putfile64 /etc/udev/rules.d/90-dri.rules ${base64encode(local.proxmox_reisen_udev_dri)}",
|
||||
"putfile64 /etc/udev/rules.d/90-z2m.rules ${base64encode(local.proxmox_reisen_udev_z2m)}",
|
||||
]
|
||||
inline = [for file in local.proxmox_reisen_files : "putfile64 ${file.dest} ${filebase64(file.path)}"]
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue