refactor(infra): wire atlas.yaml SSOT to ansible and opentofu

This commit is contained in:
v 2026-10-30 17:33:26 +03:00
parent af05ed661a
commit bb516260e2
3 changed files with 16 additions and 21 deletions

View file

@ -0,0 +1,4 @@
atlas: "{{ lookup('file', playbook_dir + '/../../atlas.yaml') | from_yaml }}"
root_domain: "{{ atlas.domain.root }}"
reality_server_name: "{{ atlas.domain.reality }}"
traefik_vip: "{{ atlas.network.traefik_vip }}"

View file

@ -4,10 +4,6 @@ variable "talos_iso_file_id" {
default = "local:iso/talos-amd64.iso"
}
# ==============================================================================
# ROUTING & EDGE (VyOS)
# ==============================================================================
resource "proxmox_virtual_environment_vm" "vyos_router" {
vm_id = 100
name = "vyos-router"
@ -69,7 +65,7 @@ resource "proxmox_virtual_environment_vm" "vyos_router" {
}
user_account {
username = "vyos"
keys = var.authorized_keys
keys = local.atlas.access.authorized_keys
}
}
@ -82,10 +78,6 @@ resource "proxmox_virtual_environment_vm" "vyos_router" {
}
}
# ==============================================================================
# TIER-0 LXC CONTAINERS (AIR-GAP FOUNDATION)
# ==============================================================================
resource "proxmox_virtual_environment_container" "dns0" {
vm_id = 101
node_name = "pve0"
@ -115,7 +107,7 @@ resource "proxmox_virtual_environment_container" "dns0" {
gateway = "10.0.10.1"
}
}
user_account { keys = var.authorized_keys }
user_account { keys = local.atlas.access.authorized_keys }
}
operating_system {
@ -162,7 +154,7 @@ resource "proxmox_virtual_environment_container" "vault0" {
gateway = "10.0.10.1"
}
}
user_account { keys = var.authorized_keys }
user_account { keys = local.atlas.access.authorized_keys }
}
operating_system {
@ -209,7 +201,7 @@ resource "proxmox_virtual_environment_container" "git0" {
gateway = "10.0.10.1"
}
}
user_account { keys = var.authorized_keys }
user_account { keys = local.atlas.access.authorized_keys }
}
operating_system {
@ -256,7 +248,7 @@ resource "proxmox_virtual_environment_container" "storage0" {
gateway = "10.0.10.1"
}
}
user_account { keys = var.authorized_keys }
user_account { keys = local.atlas.access.authorized_keys }
}
operating_system {
@ -299,7 +291,7 @@ resource "proxmox_virtual_environment_container" "registry0" {
gateway = "10.0.10.1"
}
}
user_account { keys = var.authorized_keys }
user_account { keys = local.atlas.access.authorized_keys }
}
operating_system {
@ -317,10 +309,6 @@ resource "proxmox_virtual_environment_container" "registry0" {
}
}
# ==============================================================================
# TALOS KUBERNETES CLUSTER
# ==============================================================================
resource "proxmox_virtual_environment_vm" "talos_master_1" {
vm_id = 201
name = "talos-master-1"
@ -355,7 +343,7 @@ resource "proxmox_virtual_environment_vm" "talos_master_1" {
bridge = "vmbr0"
vlan_id = 20
model = "virtio"
mac_address = "BC:24:11:71:B6:82"
mac_address = upper(local.atlas.hosts.talos_master_1.mac)
}
operating_system {
@ -401,7 +389,7 @@ resource "proxmox_virtual_environment_vm" "talos_worker_1" {
bridge = "vmbr0"
vlan_id = 20
model = "virtio"
mac_address = "BC:24:11:12:C5:1B"
mac_address = upper(local.atlas.hosts.talos_worker_1.mac)
}
network_device {
@ -453,7 +441,7 @@ resource "proxmox_virtual_environment_vm" "talos_worker_2" {
bridge = "vmbr0"
vlan_id = 20
model = "virtio"
mac_address = "BC:24:11:EF:1A:D4"
mac_address = upper(local.atlas.hosts.talos_worker_2.mac)
}
network_device {

3
tofu/locals.tf Normal file
View file

@ -0,0 +1,3 @@
locals {
atlas = yamldecode(file("${path.module}/../atlas.yaml"))
}