5 Commits

Author SHA1 Message Date
1046f9f13c Health-Metriken im Checkin + Jitter aufs Standardintervall
collect_health() sammelt Diskbelegung/RAM/Uptime/Load Average rein per
Stdlib (shutil.disk_usage, /proc/meminfo, /proc/uptime, os.getloadavg),
jeder Wert einzeln try/except. checkin() schickt das Ergebnis jetzt mit.
main()-Loop wendet 0-30 Min Jitter nur auf 'große' Intervalle (>=1h) an -
der kurze Debug-Modus (60s) und der Fallback-Retry bleiben unverjittert,
sonst würde Jitter den Debug-Zweck untergraben. Boot-Checkin war schon
vorher vorhanden (run_once() läuft immer vor der ersten sleep()), hier
nicht angefasst.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-26 10:00:48 +02:00
26fabfff03 feat: Self-Heal-Re-Bootstrap bei 401 auf Check-in
Ermöglicht die neue Reprovisionieren-Aktion im Kundenportal: wenn das
lokale Secret serverseitig ungültig gemacht wurde (Deprovisionierung),
holt sich der Agent beim nächsten Poll automatisch ein neues über den
bestehenden /api/v1/agent/bootstrap-Endpoint statt dauerhaft mit 401
hängenzubleiben.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-10 13:04:55 +02:00
03f70e747a feat: tuxflotte_auftrag_optionen an ansible-pull durchreichen
apply_roles() baut zusätzlich zu den present/absent-States ein
optionen-Dict je Rolle aus der Check-in-Antwort und gibt es im selben
--extra-vars-JSON mit (z.B. standardbrowser für brave-fedora).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-04 15:28:52 +02:00
9799a3daa0 feat: apply and report Auftragskatalog state via ansible-pull
Extends the checkin/apply cycle to cover the "auftraege" list from the
check-in response (see ADR-0010) alongside the existing workspace
blueprints: both are merged into one ansible-pull invocation, with
--tags the union of all involved roles (a catalog role needs to run
even when its target state is absent, so its removal branch executes)
and a new --extra-vars payload (tuxflotte_auftrag_states, role ->
present/absent) that ansible-content's site.yml threads down into each
role.

After the pull, reports the outcome of each Auftragskatalog entry back
via the new POST /api/v1/agent/report endpoint (applied/apply_failed/
removed/remove_failed). This is intentionally coarse: ansible-pull has
one exit code for the whole run, not per-role results, so all entries
in a given run share that outcome. Workspace blueprints are not
reported on, matching ADR-0010's scope.

Verified end to end against anode and the QEMU test VM: selecting
browser-brave as a catalog entry produced an "applied" event and the
marker file; deselecting it removed the marker and produced a
"removed" event - both written by the agent's own report call, not
simulated.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-04 09:45:07 +02:00
8382a0a949 feat: initial Provisioning Agent (check-in loop + ansible-pull)
Erste lauffaehige Version: laedt Credentials, meldet sich per Bearer-Token
bei anode/api/v1/agent/checkin, wendet zugewiesene Blueprints per
ansible-pull an und schlaeft bis zum naechsten Intervall.
2026-08-01 15:55:26 +02:00