added second proxmox node
This commit is contained in:
1 parent
961f97e566
commit
d2bc9645d1
4 files changed
+62
-16
No files matched your search
@@ -54,9 +54,29 @@ module "proxmox" {
|
||||
}
|
||||
}
|
||||
|
||||
module "pve2" {
|
||||
source = "./opentofu/modules/proxmox_node"
|
||||
|
||||
node_name = var.hypervisors["pve2"].node_name
|
||||
storage = var.hypervisors["pve2"].storage
|
||||
lxc = try(var.nodes["pve2"].lxc, {})
|
||||
machines = try(var.nodes["pve2"].machines, {})
|
||||
search_domain = local.node_common.search_domain
|
||||
dns_nameservers = local.node_common.dns_nameservers
|
||||
ssh_key = local.node_common.ssh_key
|
||||
ansible_user = local.node_common.ansible_user
|
||||
lxc_password = local.node_common.lxc_password
|
||||
ssh_private_key_path = local.node_common.ssh_private_key_path
|
||||
|
||||
providers = {
|
||||
proxmox = proxmox.pve2
|
||||
}
|
||||
}
|
||||
|
||||
locals {
|
||||
hv_hosts = {
|
||||
proxmox = { lxc = module.proxmox.lxc_hosts, vm = module.proxmox.vm_hosts }
|
||||
pve2 = { lxc = module.pve2.lxc_hosts, vm = module.pve2.vm_hosts }
|
||||
}
|
||||
|
||||
all_hosts = flatten([
|
||||
|
||||
@@ -72,3 +72,11 @@ provider "proxmox" {
|
||||
pm_api_token_secret = data.external.infisical.result["hv2_token_secret"]
|
||||
pm_tls_insecure = true
|
||||
}
|
||||
|
||||
provider "proxmox" {
|
||||
alias = "pve2"
|
||||
pm_api_url = var.hypervisors["pve2"].api_url
|
||||
pm_api_token_id = data.external.infisical.result["token_id"]
|
||||
pm_api_token_secret = data.external.infisical.result["pve2_token_secret"]
|
||||
pm_tls_insecure = true
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
{{- range $secret := $secrets }}
|
||||
{{- if eq $secret.Key "HV_USER" }}"token_id": "{{$secret.Value}}",{{ end }}
|
||||
{{- if eq $secret.Key "PROXMOX_TOKEN_SECRET" }}"hv2_token_secret": "{{$secret.Value}}",{{ end }}
|
||||
{{- if eq $secret.Key "PVE2_TOKEN_SECRET" }}"pve2_token_secret": "{{$secret.Value}}",{{ end }}
|
||||
{{- if eq $secret.Key "LXC_PASSWORD" }}"lxc_password": "{{$secret.Value}}",{{ end }}
|
||||
{{- if eq $secret.Key "SSH_PRIVATE_KEY" }}"ssh_private_key_b64": "{{$secret.Value}}",{{ end }}
|
||||
{{- if eq $secret.Key "SSH_PUBLIC_KEY" }}"ssh_public_key": "{{$secret.Value}}",{{ end }}
|
||||
|
||||
+33
-16
@@ -6,6 +6,11 @@ hypervisors = {
|
||||
node_name = "pve"
|
||||
storage = "local-lvm"
|
||||
}
|
||||
pve2 = {
|
||||
api_url = "https://192.168.0.241:8006/api2/json"
|
||||
node_name = "pve"
|
||||
storage = "local-lvm"
|
||||
}
|
||||
}
|
||||
|
||||
ipam_endpoint = "https://ipam.example.net/api"
|
||||
@@ -38,11 +43,13 @@ dns_records = [
|
||||
{ zone = "oswaldtheotter.lan", name = "omada", type = "A", value = "192.168.0.110" },
|
||||
{ zone = "oswaldtheotter.lan", name = "portanas", type = "A", value = "192.168.0.4" },
|
||||
{ zone = "oswaldtheotter.lan", name = "proxmox", type = "A", value = "192.168.0.240" },
|
||||
{ zone = "oswaldtheotter.lan", name = "pve", type = "A", value = "192.168.0.241" },
|
||||
{ zone = "oswaldtheotter.lan", name = "nas", type = "CNAME", value = "portanas.oswaldtheotter.lan" },
|
||||
{ zone = "oswaldtheotter.lan", name = "s3", type = "CNAME", value="portanas.oswaldtheotter.lan"},
|
||||
{ zone = "oswaldtheotter.lan", name = "hass", type = "A", value="192.168.0.70"},
|
||||
{ zone = "oswaldtheotter.lan", name = "homeassistant", type = "CNAME", value="hass.oswaldtheotter.lan"},
|
||||
{ zone = "oswaldtheotter.lan", name = "bookstack", type = "A", value="192.168.0.5"},
|
||||
{ zone = "oswaldtheotter.lan", name = "code", type = "A", value="192.168.0.5"},
|
||||
]
|
||||
|
||||
|
||||
@@ -76,6 +83,10 @@ caddy_proxies = {
|
||||
host = "bookstack.oswaldtheotter.lan"
|
||||
upstreams = ["192.168.0.4:30214"]
|
||||
}
|
||||
code = {
|
||||
host = "code.oswaldtheotter.lan"
|
||||
upstreams = ["192.168.0.200:8080"]
|
||||
}
|
||||
}
|
||||
|
||||
# ── Node definitions ───────────────────────────────────────────────────────────
|
||||
@@ -99,22 +110,6 @@ nodes = {
|
||||
nameserver = "192.168.0.2"
|
||||
gw = "192.168.0.1"
|
||||
}
|
||||
"dev" = {
|
||||
hostname = "dev"
|
||||
vmid = 800
|
||||
template = "local:vztmpl/debian-13-standard_13.1-2_amd64.tar.zst"
|
||||
unprivileged = true
|
||||
onboot = true
|
||||
tags = ""
|
||||
memory = 2048
|
||||
swap = 1024
|
||||
disk_size = "32G"
|
||||
nic_name = "eth0"
|
||||
bridge = "vmbr0"
|
||||
ip = "192.168.0.200/24"
|
||||
nameserver = "192.168.0.2"
|
||||
gw = "192.168.0.1"
|
||||
}
|
||||
"audiopen" = {
|
||||
hostname = "audiopen"
|
||||
vmid = 801
|
||||
@@ -164,4 +159,26 @@ nodes = {
|
||||
machines = {
|
||||
}
|
||||
}
|
||||
pve2 = {
|
||||
lxc = {
|
||||
"dev" = {
|
||||
hostname = "dev"
|
||||
vmid = 200
|
||||
template = "local:vztmpl/debian-13-standard_13.1-2_amd64.tar.zst"
|
||||
unprivileged = true
|
||||
onboot = true
|
||||
tags = ""
|
||||
memory = 4096
|
||||
swap = 2048
|
||||
disk_size = "32G"
|
||||
nic_name = "eth0"
|
||||
bridge = "vmbr0"
|
||||
ip = "192.168.0.200/24"
|
||||
nameserver = "192.168.0.2"
|
||||
gw = "192.168.0.1"
|
||||
}
|
||||
}
|
||||
machines = {
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user