DmitryandClaude Sonnet 5 a3fe8031fe feat: migrate all managed LXC provisioning to OpenTofu (blue-green)
Blue-green: a new container is created beside the old one, data is copied, the
IP is moved onto it, and the old container is kept stopped as rollback for at
least a week. Keeping the IP means only the VMID changes, and its consumers
(backup jobs, backup audit) already derive it from the registry.

Batch 1 (2026-09-02): emergency-bot 148->151, docker-test 145->152,
gitea 141->153, vaultwarden 140->154, monitoring 146->155, gyro 150->156,
grimmory 149->157.
Batch 2 (2026-09-03): adguard 144->158, mihomo 143->159, ovpn-mini 132->160.
All migratable LXC are now provisioner: tofu. hermes-ai (frozen) and pbs stay.

- tofu/services.tf + tofu/svc-*.tf: one resource per service, reproducing the
  pct-config etalon. /dev/fuse -> features.fuse; /dev/net/tun ->
  device_passthrough (first live use on mihomo and ovpn-mini); gitea bind mount
  -> datastore volume (data finally reaches PBS); console { type = "shell" }
  declared explicitly (provider tracks cmode there).
- services.yml: vmid + provisioner: tofu for every migrated service; features
  strings and device notes updated to the tofu representation; also drops the
  memoir-bot entry and adds homelab_reverse_proxy_image/_unit.
- pve-*.yml: configuration play target is `{{ pve_config_target | default(...) }}`
  so it can run against <name>-new on a temp address (a bare --limit zeroes the
  play instead of retargeting it). Container-creation plays are gated behind
  `provisioner != 'tofu'` / `pve_provisioning_enabled` (meta: end_play), so a
  stray run cannot pct start a stopped OLD VMID on a live IP. Override for
  intentional legacy rollback: -e pve_<svc>_legacy_provisioning_enabled=true.
- ssh_config: drop memoir-bot; ovpn-mini gets ProxyJump none (a jump via ru-vps
  would route through the very tunnel ovpn-mini terminates).
- gyro.yml / uptime-kuma.yml: same pve_config_target override.
- roles/uptime_kuma: only freeze homelab-monitoring when the unit actually
  exists (a fresh blue-green container never had it).
- offsite-restic-yadisk.yml: the gitea restic profile now runs inside the LXC
  (hosts: gitea), since the bind-mount host path is gone after the volume move;
  lost+found excluded (unreadable in an unprivileged LXC, restic exit 3).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012uoq5AVK8mkBgg83Mq6o5V
2026-09-03 07:05:46 +03:00
2026-08-26 22:09:59 +03:00

HomeLab Infrastructure

Активная инфраструктура домашней лаборатории управляется через Ansible. Каноничные инструкции для людей и агентов — в AGENTS.md.

Быстрый старт

Окружение собрано в Nix, venv не нужен:

nix develop                 # или один раз: direnv allow

# Один раз на клон
ansible-galaxy collection install -r ansible/requirements.yml -p ansible/collections

Всё управление — через make из ansible/:

cd ansible
make help                   # список целей, начинать отсюда
make check                  # связность и ожидаемые IP
make status                 # read-only сводка по всей инфраструктуре
make lint                   # ansible-lint + yamllint

Деплой и обновления:

make dry-gitea              # предпросмотр (--check --diff)
make deploy-gitea           # применить
make update-gitea           # бэкап -> обновление -> health-check

.env с Proxmox-токенами подхватывается автоматически. Опасные цели требуют CONFIRM=1.

SSH руками

ansible/ssh_config — единый источник правды по SSH и для Ansible, и для терминала. Добавь в ~/.ssh/config, чтобы заработал ssh gitea:

Include /home/ada/Documents/Projects/HomeLab/infras/ansible/ssh_config

Структура

  • ansible/ — control plane: Makefile, inventory/, playbooks/, roles/, ssh_config
  • ansible/inventory/group_vars/all/services.yml — реестр сервисов (VMID, IP, порты, домены, образы)
  • flake.nix — dev-окружение
  • .gitea/workflows/lint.yml — CI: yamllint, ansible-lint, syntax-check
  • archive/2026-07-proxmox-migration/ — исторические NixOS/Docker конфиги, только как справка

Grimmory MCP

tools/grimmory-mcp/ содержит read-only интеграцию с Grimmory API для OpenCode и явно вызываемые инструменты синхронизации с Obsidian.

npm install --prefix tools/grimmory-mcp
npm run configure --prefix tools/grimmory-mcp
npm test --prefix tools/grimmory-mcp

OpenCode регистрирует сервер глобально. После перезапуска OpenCode используй /grimmory-sync для обновления заметок книг в 90 Library/Books и обложек в 99 System/Export/Grimmory/Covers.

S
Description
No description provided
Readme
1.7 MiB
Languages
HCL 25%
Jinja 24.4%
JavaScript 22.3%
Makefile 9.7%
Nix 6.7%
Other 11.9%