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.
1.7 KiB
1.7 KiB
provisioning-agent
Der Tuxflotte Provisioning Agent läuft auf installierten Geräten, meldet sich in regelmäßigen Abständen bei anode und wendet die ihm zugewiesenen Ansible-Rollen per ansible-pull an (siehe ansible-content/).
Stand: erste lauffähige Version. Die Einrichtung vor dem ersten Reboot (backend_postinstall()) ist noch nicht angebunden — Bootstrap läuft aktuell über den Dev-Endpoint POST /api/v1/agent/bootstrap.
Manuelle Installation (Testgerät)
Voraussetzung: ansible-core ist installiert (ansible-pull im PATH).
-
Gerät aktivieren und Bereitstellungsvorlage zuweisen (bestehender Provisioning-Flow, siehe
provisioning-server) -
Agent-Secret erzeugen:
curl -X POST https://anode.tuxflotte.de/api/v1/agent/bootstrap \ -H "Content-Type: application/json" \ -d '{"device_id": "<device-uuid>"}' -
Credentials ablegen:
install -d -m 0700 /etc/tuxflotte cat > /etc/tuxflotte/agent.credentials <<EOF {"device_id": "<device-uuid>", "agent_secret": "<agent-secret aus Schritt 2>"} EOF chmod 0600 /etc/tuxflotte/agent.credentials -
Agent-Code ablegen und Dienst einrichten:
install -d /opt/tuxflotte/agent cp agent.py /opt/tuxflotte/agent/ cp tuxflotte-agent.service /etc/systemd/system/ systemctl daemon-reload systemctl enable --now tuxflotte-agent -
Prüfen:
journalctl -u tuxflotte-agent -f ls /run/tuxflotte/agent/applied/
Konfiguration
| Umgebungsvariable | Zweck | Default |
|---|---|---|
TUXFLOTTE_ANODE_URL |
Basis-URL des Provisioning-Servers | https://anode.tuxflotte.de |
TUXFLOTTE_AGENT_CREDENTIALS |
Pfad zur Credentials-Datei | /etc/tuxflotte/agent.credentials |