- Full Obsidian vault content - Host configs (ice, grizzley, ubuntu, proxmox, truenas, panda, hyte) - Media stack documentation - Traefik HA setup - Automation scripts - Bachelor party planning
63 lines
2.1 KiB
Markdown
63 lines
2.1 KiB
Markdown
---
|
|
title: GitOps
|
|
created: 2026-04-28
|
|
updated: 2026-04-28
|
|
type: concept
|
|
tags: [concept, git, automation]
|
|
sources: [../automation/scripts.md, ../../homelab/architecture.md]
|
|
---
|
|
|
|
# GitOps
|
|
|
|
The homelab uses a GitOps pattern where the git repository IS the infrastructure.
|
|
|
|
## Core Principle
|
|
|
|
All configuration lives in `/home/bear/homelabagentroot/`. Each host pulls its configs from the repo. Agents (Hermes, OpenCode) commit changes and push to Gitea. Other hosts pull on next session.
|
|
|
|
## Repository Structure
|
|
|
|
```
|
|
homelabagentroot/
|
|
├── homelab/ # Infrastructure configs per host
|
|
│ ├── ubuntu/ # Docker Compose, configs
|
|
│ ├── grizzley/ # RPi5 edge configs
|
|
│ ├── ice/ # Control plane configs
|
|
│ └── proxmox/ # VM/LXC configs
|
|
├── scripts/ # Shared automation
|
|
├── ansible/ # Playbooks for deployment
|
|
├── obsidian-vault/ # Wiki (IS the vault)
|
|
└── .opencode/ # OpenCode agent config
|
|
```
|
|
|
|
## Git Triggers
|
|
|
|
| Action | What Happens |
|
|
|--------|-------------|
|
|
| Agent commits & pushes | Configs pushed to Gitea |
|
|
| Other host pulls | Gets latest configs |
|
|
| Drift detected | `detect-drift.py` or `drift_detector.py` flags differences |
|
|
| Manual deploy | `ansible-playbook deploy-services.yml --limit <host>` |
|
|
|
|
## Agents Using GitOps
|
|
|
|
| Agent | Host | Role |
|
|
|-------|------|------|
|
|
| Hermes | ice, grizzley | Commit infra changes, push to Gitea |
|
|
| OpenCode | ubuntu, ice | Read/write configs, run Ansible |
|
|
| Gitea | ubuntu | GitOps hub — all repos live here |
|
|
|
|
## Key Files
|
|
|
|
- `scripts/homelab/deploy-service.py` — Deploy services to remote hosts
|
|
- `scripts/homelab/detect-drift.py` — Detect config drift between repo and hosts
|
|
- `ansible/playbooks/deploy-services.yml` — Restart Docker services
|
|
- `ansible/playbooks/sync-configs.yml` — Pull/push docker-compose configs
|
|
|
|
## Related
|
|
|
|
- [[gitea]] — Git host and GitOps runner hub
|
|
- [[ubuntu]] — Primary Docker host where most configs deploy
|
|
- [[ice]] — Control plane, primary Hermes Agent host
|
|
- [[deployment-scripts]] — Full automation scripts inventory
|