single playbook for mediapis

This commit is contained in:
2026-09-10 21:33:19 +02:00
parent dae2470e67
commit 85a26db46b
13 changed files with 121 additions and 128 deletions

View File

@@ -6,10 +6,13 @@ Pis (audio players, sensors, music mouse, etc.) plus one home server.
## Layout
- `inventory.yml` — hosts and group vars (Pis under `iot`, plus `server`).
- `full.yml`, `working.yml`, `server.yml`, `newrpi-provisioning.yml`,
`octopisetup.yml` — top-level playbooks. `full.yml` is the closest thing to
a canonical "apply everything" playbook; the others are narrower/ad-hoc
runs kept around for specific hosts or one-off tasks.
`group_vars/` and `host_vars/` hold vars for the `mediapis` group (the four
parallel audio-player Pis) and their host-specific overrides.
- `mediapis.yml`, `working.yml`, `server.yml`, `newrpi-provisioning.yml`,
`octopisetup.yml` — top-level playbooks. `mediapis.yml` is the canonical
playbook for the `mediapis` group (`musikserverwohnzimmeroben`, `kitchenpi`,
`bedroompi`, `musicmouse`); the others are narrower/ad-hoc runs kept around
for specific hosts or one-off tasks.
- `roles/` — one role per piece of functionality (audio backends, sensors,
bluetooth monitoring, server basics, etc.). Each has a short `README.md`.
- `update-packages.yml` — deliberate, fleet-wide package update (see
@@ -41,7 +44,7 @@ password.
## Running a playbook
```
ansible-playbook full.yml --limit <host>
ansible-playbook mediapis.yml --limit <host>
```
`ansible.cfg` points Ansible at `inventory.yml` and `roles/` by default, so
@@ -49,13 +52,13 @@ no extra flags are needed for those.
## Keeping packages up to date
Regular playbook runs (`full.yml`, `server.yml`, etc.) use `state: present`
Regular playbook runs (`mediapis.yml`, `server.yml`, etc.) use `state: present`
for packages, so they only install what's missing — they never upgrade
anything as a side effect of an unrelated config change. Two separate,
deliberate mechanisms handle upgrades instead:
**Security patches — automatic.** The `unattended_upgrades` role (applied
to every host in `full.yml`/`server.yml`) configures `unattended-upgrades`
to every host in `mediapis.yml`/`server.yml`) configures `unattended-upgrades`
to install security-origin updates automatically, with a scheduled reboot
window (default 03:00, see `roles/unattended_upgrades/defaults/main.yml`)
for patches that need one. Not scoped to full dist-upgrades.