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.
56 lines
3.3 KiB
PL/PgSQL
56 lines
3.3 KiB
PL/PgSQL
BEGIN;
|
|
|
|
-- Backends
|
|
|
|
INSERT INTO backends (id, key, name, installer_type, version) VALUES
|
|
('22222222-2222-4222-8222-222222222222', 'fedora', 'Fedora', 'kickstart', '40'),
|
|
('33333333-3333-4333-8333-333333333333', 'mint', 'Linux Mint', 'autoinstall', '22');
|
|
|
|
-- Workspaces (global, organization_id NULL)
|
|
|
|
INSERT INTO workspaces (id, organization_id, key, name, description) VALUES
|
|
('44444444-4444-4444-8444-444444444444', NULL, 'schulcomputer', 'Schulcomputer',
|
|
'Arbeitsplatz fuer den Schuleinsatz mit fluechtiger Gastsitzung.'),
|
|
('55555555-5555-4555-8555-555555555555', NULL, 'entwickler', 'Entwickler',
|
|
'Arbeitsplatz fuer Softwareentwicklung. Merkmale noch nicht konkretisiert.');
|
|
|
|
-- Merkmale (bisher nur fuer Schulcomputer konkretisiert)
|
|
|
|
INSERT INTO merkmale (id, key, name, description) VALUES
|
|
('66666666-6666-4666-8666-666666666666', 'guest-session-ephemeral', 'Fluechtige Gastsitzung',
|
|
'Loescht Dateien, Cache und Verlauf beim Abmelden.'),
|
|
('77777777-7777-4777-8777-777777777777', 'browser-brave', 'Brave Browser', NULL),
|
|
('88888888-8888-4888-8888-888888888888', 'office-onlyoffice', 'OnlyOffice', NULL);
|
|
|
|
INSERT INTO workspace_merkmale (workspace_id, merkmal_id) VALUES
|
|
('44444444-4444-4444-8444-444444444444', '66666666-6666-4666-8666-666666666666'),
|
|
('44444444-4444-4444-8444-444444444444', '77777777-7777-4777-8777-777777777777'),
|
|
('44444444-4444-4444-8444-444444444444', '88888888-8888-4888-8888-888888888888');
|
|
|
|
-- Blueprints je Merkmal x Backend (Ansible-Rollen aus ADR-0002 uebernommen bzw. nach demselben Schema ergaenzt)
|
|
|
|
INSERT INTO blueprints (id, merkmal_id, backend_id, ansible_role) VALUES
|
|
('b1000000-0000-4000-8000-000000000001', '66666666-6666-4666-8666-666666666666', '22222222-2222-4222-8222-222222222222', 'guest-session'),
|
|
('b1000000-0000-4000-8000-000000000002', '66666666-6666-4666-8666-666666666666', '33333333-3333-4333-8333-333333333333', 'guest-session'),
|
|
('b1000000-0000-4000-8000-000000000003', '77777777-7777-4777-8777-777777777777', '22222222-2222-4222-8222-222222222222', 'brave-fedora'),
|
|
('b1000000-0000-4000-8000-000000000004', '77777777-7777-4777-8777-777777777777', '33333333-3333-4333-8333-333333333333', 'brave-mint'),
|
|
('b1000000-0000-4000-8000-000000000005', '88888888-8888-4888-8888-888888888888', '22222222-2222-4222-8222-222222222222', 'onlyoffice-fedora'),
|
|
('b1000000-0000-4000-8000-000000000006', '88888888-8888-4888-8888-888888888888', '33333333-3333-4333-8333-333333333333', 'onlyoffice-mint');
|
|
|
|
-- Bereitstellungsvorlagen fuer die bestehende "Default Lab"-Organisation
|
|
|
|
INSERT INTO bereitstellungsvorlagen (id, organization_id, workspace_id, backend_id, label, is_default) VALUES
|
|
('c1000000-0000-4000-8000-000000000001', '11111111-1111-4111-8111-111111111111',
|
|
'44444444-4444-4444-8444-444444444444', '22222222-2222-4222-8222-222222222222',
|
|
'Schulcomputer (Fedora)', TRUE),
|
|
('c1000000-0000-4000-8000-000000000002', '11111111-1111-4111-8111-111111111111',
|
|
'44444444-4444-4444-8444-444444444444', '33333333-3333-4333-8333-333333333333',
|
|
'Schulcomputer (Mint)', FALSE);
|
|
|
|
-- Aktivierungscode (Ablösung des bisherigen config.json-Eintrags)
|
|
|
|
INSERT INTO activation_codes (code, organization_id, active) VALUES
|
|
('LAB-2026-START', '11111111-1111-4111-8111-111111111111', TRUE);
|
|
|
|
COMMIT;
|