-
Notifications
You must be signed in to change notification settings - Fork 0
Architecture
Osotechie edited this page Jun 22, 2026
·
1 revision
This page provides the high-level view of how everything fits together — from a git push to a fully provisioned NAS.
flowchart TD
subgraph GitHub
A[nas-as-code<br/>Ansible] --> GA[GitHub Actions]
B[nas-containers-as-code<br/>Docker Compose] --> GB[GitHub Actions]
end
GA --> KV[Azure KeyVault<br/>secrets pulled at runtime]
GB --> KV
KV --> WG[WireGuard VPN Tunnel<br/>runner → home network]
WG --> NAS
subgraph NAS
MFS[MergerFS<br/>Storage Pool]
SMB[Samba<br/>Shares]
DCK[Docker<br/>Stacks]
BKP[Backups<br/>LVM]
end
- Push to
maintriggers the Provision workflow - Workflow runs as a matrix — deploys to
testfirst, thenproduction - Connects to Azure → pulls all secrets from KeyVault
- Replaces
#{TOKEN}#patterns in Ansible group_vars with secret values - Establishes WireGuard tunnel to home network
- Runs Ansible playbook over SSH against the NAS
- Generates a deployment summary report in the GitHub Actions job summary
- Push to
maintriggers the Deploy workflow - Connects to Azure → pulls secrets → replaces tokens in
.envfiles - Establishes WireGuard tunnel
- Creates a Docker context pointing at the NAS over SSH
- Iterates through each stack directory, running
docker compose up -d - Syncs the repo content to
/config/stackson the NAS for local reference
| Environment | Purpose | When |
|---|---|---|
test |
Validate changes on a test NAS instance | First in matrix |
production |
Apply to the real NAS | After test succeeds |
Both environments share the same Ansible code but have their own GitHub Environment with distinct secrets and variables.
- Idempotent — run it once or ten times, same result
- Secrets never in code — everything sensitive lives in Azure KeyVault
- Minimal NAS surface — the OS is kept lean, everything runs in Docker
- Recoverable — the NAS can be rebuilt from scratch using just these repos + KeyVault
Overview
Secrets & Networking
Ansible
- Ansible Structure
- Role: Docker
- Role: Storage
- Role: Samba
- Role: NUT Client
- Role: Backup
- Role: Coral TPU
Pipelines
Operations