feat(terraform): declare CT 901 core-secrets on netcore
This commit is contained in:
1 parent
3f306a0891
commit
3cefc59aee
3 files changed
+67
-3
No files matched your search
@@ -38,13 +38,16 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
# Гарантированный резолв локальной Gitea внутри Docker-раннера
|
# Направляем gitea.gunihome.ru на актуальный шлюз Traefik (core-net 192.168.1.104)
|
||||||
if ! grep -q "gitea.gunihome.ru" /etc/hosts; then
|
if ! grep -q "gitea.gunihome.ru" /etc/hosts; then
|
||||||
echo "192.168.1.201 gitea.gunihome.ru" >> /etc/hosts
|
echo "192.168.1.104 gitea.gunihome.ru" >> /etc/hosts
|
||||||
|
else
|
||||||
|
sed -i 's/192.168.1.201/192.168.1.104/g' /etc/hosts
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -rf "${HOME}/homelab-infra"
|
rm -rf "${HOME}/homelab-infra"
|
||||||
git clone https://gitea.gunihome.ru/karpenok/homelab-infra.git "${HOME}/homelab-infra"
|
# Клонируем по прямому IP Gitea, чтобы не зависеть от внешних факторов
|
||||||
|
git clone http://192.168.1.217:3000/karpenok/homelab-infra.git "${HOME}/homelab-infra"
|
||||||
sha="${GITHUB_SHA:-${GITEA_SHA:-}}"
|
sha="${GITHUB_SHA:-${GITEA_SHA:-}}"
|
||||||
if [ -n "${sha}" ]; then
|
if [ -n "${sha}" ]; then
|
||||||
git -C "${HOME}/homelab-infra" checkout "${sha}"
|
git -C "${HOME}/homelab-infra" checkout "${sha}"
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
resource "proxmox_virtual_environment_container" "core_secrets" {
|
||||||
|
description = "Managed by Terraform: core-secrets Zero-Day Secrets Vault (Infisical, Vaultwarden, Agent Vault)"
|
||||||
|
node_name = var.proxmox_node
|
||||||
|
|
||||||
|
vm_id = 901
|
||||||
|
unprivileged = true
|
||||||
|
started = true
|
||||||
|
|
||||||
|
initialization {
|
||||||
|
hostname = "core-secrets"
|
||||||
|
|
||||||
|
ip_config {
|
||||||
|
ipv4 {
|
||||||
|
address = "192.168.1.102/24"
|
||||||
|
gateway = "192.168.1.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
user_account {
|
||||||
|
keys = var.ssh_public_keys
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
network_interface {
|
||||||
|
name = "eth0"
|
||||||
|
bridge = "vmbr10"
|
||||||
|
}
|
||||||
|
|
||||||
|
operating_system {
|
||||||
|
template_file_id = "local:vztmpl/debian-13-standard_13.6-1_amd64.tar.zst"
|
||||||
|
type = "debian"
|
||||||
|
}
|
||||||
|
|
||||||
|
cpu {
|
||||||
|
cores = 2
|
||||||
|
}
|
||||||
|
|
||||||
|
memory {
|
||||||
|
dedicated = 4096
|
||||||
|
swap = 2048
|
||||||
|
}
|
||||||
|
|
||||||
|
disk {
|
||||||
|
datastore_id = "local-lvm"
|
||||||
|
size = 20
|
||||||
|
}
|
||||||
|
|
||||||
|
features {
|
||||||
|
nesting = true
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,3 +7,13 @@ output "core_net_ip" {
|
|||||||
description = "IPv4 адрес контейнера core-net"
|
description = "IPv4 адрес контейнера core-net"
|
||||||
value = proxmox_virtual_environment_container.core_net.initialization[0].ip_config[0].ipv4[0].address
|
value = proxmox_virtual_environment_container.core_net.initialization[0].ip_config[0].ipv4[0].address
|
||||||
}
|
}
|
||||||
|
|
||||||
|
output "core_secrets_id" {
|
||||||
|
description = "VMID контейнера core-secrets"
|
||||||
|
value = proxmox_virtual_environment_container.core_secrets.vm_id
|
||||||
|
}
|
||||||
|
|
||||||
|
output "core_secrets_ip" {
|
||||||
|
description = "IPv4 адрес контейнера core-secrets"
|
||||||
|
value = proxmox_virtual_environment_container.core_secrets.initialization[0].ip_config[0].ipv4[0].address
|
||||||
|
}
|
||||||
Reference in new issue
Block a user