Purpose
This monorepo has 3 uses:
- Setup infrastructure
- Maintain infrastructure
- Document infrastructure
The inventory defines the lab's infrastructure. The config defines the state we want the infrastructure to be in. For a given inventory, the playbook should be idempotent.
Structure
src/
├── network
│ ├── tasks
│ └── templates
├── pi
│ ├── files
│ ├── tasks
│ ├── templates
│ └── vars
└── servers
├── files
├── tasks
└── vars
Network
- Wireguard (Idempotent if atomic)
Sets up the VPN on the master and slaves. Idempotent only if run on all the nodes and slaves at once (atomic)
- VLANs
To be run only on router. Idempotency not guaranteed.
- DNS
Setup DNS on all the hosts. Idempotent.
Pi
- PiHole
Setup the PiHole service. Idempotent.
- PXE
Setup PXE boot serviec. Idempotent.
Servers
- Base
Install required packages on the hosts. Idempotent.
- Services
Install and setup services on hosts. Idempotent.
Playbook Loops
Each loop is a idempotent loop playbook which does certain actions.
Setup Playbook
Used for the inital homelab setup.
Steps:
- src/pi
- Start PXE
- Start PiHole
- PXE boot all hosts with kickstart files
- src/network
- Apply VLAN settings
- Apply DNS settings
- Apply VPN settings
- src/servers
- Install base packages
- Start up required services on cluster
- Misc - Print manual config - router, NAS etc.
Maintenance Playbook
Used for upgrades, backups, and bringing services/networks up and down.
Steps:
- src/pi
- Start PXE
- Start PiHole
- PXE boot all hosts with kickstart files
- src/network
- Apply VLAN settings
- Apply DNS settings
- Apply VPN settings
- src/servers
- Install base packages
- Start up required services on cluster
- Misc - Print manual config - router, NAS etc.