14 Commits

Author SHA1 Message Date
eb73f2b6b7 feat: extend agent check-in with Auftragskatalog state, add report endpoint
Check-in now also returns "auftraege": the full present/absent state
of every catalog-eligible Merkmal (im_auftragskatalog = true) for the
device's backend, derived statelessly from device_merkmale rather than
just the workspace-resolved blueprints list, which stays untouched.
This is what lets a deselected Auftrag actually be reverted once the
corresponding Ansible role grows an absent branch (ADR-0010) - the
agent doesn't have that branch yet, so this is additive and inert
until it does.

Adds POST /api/v1/agent/report so the agent can write execution
results (applied/apply_failed/removed/remove_failed) back into
device_merkmal_events; selected/deselected is intentionally rejected
here since those are meant to come from wherever Auftrag selection
ends up being triggered, not from the agent itself.

Migration 0007 adds the backing tables (kategorien, device_merkmale,
device_merkmal_events) and the two new merkmale columns.

Verified against anode: checkin toggles present/absent correctly
after inserting a device_merkmale row, report endpoint accepts valid
entries and rejects unknown merkmale / non-agent event types / bad
secrets, and the written event round-trips through device_merkmal_events
correctly as jsonb.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-04 09:17:19 +02:00
341ef92a7a feat: add provisioning agent bootstrap and check-in endpoints
Adds POST /api/v1/agent/bootstrap (issues a hashed agent secret for a
device) and POST /api/v1/agent/checkin (Bearer-authenticated, resolves
the device's assigned blueprints via its Bereitstellungsvorlage and
returns them alongside the ansible-content repo URL and poll
interval). Migration 0006 adds the backing columns on devices
(agent_secret_hash, agent_secret_issued_at, agent_last_checkin).

This was implemented and verified end to end (activate -> resolve ->
bootstrap -> checkin, plus a full QEMU agent test) in an earlier
session but never committed to this repo, even though it has been
running in production on anode since. Committing now to close that
gap before building on top of it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-04 09:16:58 +02:00
e02b646564 fix: return backend/workspace key instead of internal UUID in resolved Runtime Blueprint
runtime_blueprint.backend_id/workspace_id must be the stable, distro-neutral
key (e.g. "fedora") as documented in 08-provisioning-api.md, not the
internal database UUID - the installer's backend dispatch
(backends/${backend_id}/backend.sh) depends on it being a directory-safe
key.
2026-07-18 10:48:50 +02:00
11186dfdf9 feat: migrate provisioning API to Merkmal/Blueprint/Bereitstellungsvorlage model
Replaces the config.json-backed flat profile model with the
Postgres-backed Workspace/Merkmal/Backend/Blueprint/Bereitstellungsvorlage
schema (migrations 0003-0005). /api/v1/activate now returns Bereitstellungsvorlage
templates instead of profiles, and a new POST /api/v1/templates/{id}/resolve
endpoint resolves a chosen template to a full Runtime Blueprint (workspace,
backend, resolved Merkmal->Ansible-role blueprints, and installation
directives), recording the resulting device assignment.

Removes the now-unused config.json and file-based device registry
directory in favor of the PostgreSQL-backed activation codes and
device tables.
2026-07-18 10:48:29 +02:00
02e2b9de94 refactor: expose device registration status 2026-07-14 13:04:39 +02:00
9c773e7b9b feat: persist hardware snapshots during activation 2026-07-13 09:00:02 +02:00
ba2dccff57 fix: correct PostgreSQL device row mapping 2026-07-12 15:32:43 +02:00
2683b65ffc feat: migrate device registry to PostgreSQL 2026-07-12 15:22:22 +02:00
8d70236ef5 feat: add PostgreSQL persistence foundation 2026-07-12 14:33:31 +02:00
de51278d69 feat: add initial device registry 2026-07-10 16:54:17 +02:00
root
9fca3675b7 Update Fedora kickstart localization and bootstrap 2026-07-03 09:59:46 +00:00
f3e85a9746 Switch service URLs to tuxflotte.de 2026-07-03 11:57:59 +02:00
root
e20a536002 Add Fedora kickstart installer endpoint 2026-06-16 16:38:38 +00:00
root
c61a2e5994 Initial provisioning server 2026-06-14 19:08:19 +00:00