Life-Cycle
Update
One command for Debian, app, modules and configuration – nightly if you like, and a controlled move to a new Debian release.
update
In the guest as root:
update
What it does, in order:
- Load the current state of iac-core and the app (to
/var/lib/iac/src/). - Update the Debian packages (
full-upgradewithin the Debian release; your changed configuration files are kept) and purge what removed packages left behind – never the data of a database. The nightly run (auto-update) then restarts the services that still run with replaced libraries; by hand they are only listed. - Establish the target state: app version, modules, configuration, firewall. A service restarts only if something it depends on changed.
- Check that the services run and the app answers, then write
/etc/iac/instance.json.
etckeeper snapshots /etc before and after, so git -C /etc log shows exactly what changed.
When a reboot is due (a new kernel, say), update tells you at the end – it never reboots on its
own. Run it as often as you like: a second run changes nothing.
Nightly update
The module auto-update runs update nightly at 02:00 and is preselected
for new guests. Older guests that predate it pick it up with update -am auto-update;
update -rm auto-update drops it again.
systemctl list-timers iac-auto-update.timer # next run
journalctl -u iac-auto-update # output of the last runs
If a nightly run fails, the guest stays as it was. Each run – even one that aborts or can’t download
haypack – records its outcome in /var/lib/iac/update.json:
{ "time": "2026-10-22T02:00:13Z", "status": "failed", "exit_code": 1 }
Details land in /var/log/iac/iac.log. Tools can read the JSON file instead of parsing logs;
NetBox provisioning shows it per guest.
App versions
- Debian apps update along with the rest of the Debian packages.
- Most apps from GitHub, Codeberg or npm are pinned:
updateinstalls the version haypack built and boot-tested. Newer upstream releases get bumped automatically once the tests pass; a new major version waits for a review. - Apps without a pin move to the latest upstream release. With a major lock (e.g. Traefik) they stay within their major version, and a new major version is only reported – the app’s migration guide describes the move.
updatenever downgrades. Some apps, Traefik among them, roll back by themselves if their update fails.
Options
| Command | Effect |
|---|---|
update | normal update |
update -lm, --list-modules | modules for this guest as a numbered table, active ones with ✓ |
update -am a,b, --add-modules | add modules, by name or number (update -am 1,3, modules) |
update -rm a,b, --remove-modules | remove modules, data stays |
update --modules a,b | set the module selection ('' = none) |
update --release-upgrade | move to the next Debian release |
update -y | no questions |
update -h, --help | help with all options, examples and important files |
| Environment | Effect |
|---|---|
IAC_OFFLINE=1 | use the sources in /var/lib/iac/src/, download nothing |
IAC_CORE_REF, IAC_APP_REF | another branch or tag of iac-core or the app (for tests) |
IAC_VERBOSE=1 | show every Ansible task result |
New Debian release
haypack never switches Debian releases on its own. When the next release has gone stable:
update --release-upgrade
It first checks that the new release is already stable and that there’s enough free space,
then establishes the target state as usual. Take a backup or a Proxmox snapshot beforehand.
When update fails
tail -n 100 /var/log/iac/iac.log # what went wrong
IAC_VERBOSE=1 update # again, with every task result
bash /var/lib/iac/src/core/bin/iac-smoke # what runs, what does not
Whatever a failed run leaves behind, the next one can repair: fix the cause (network, disk
space, a broken local file) and run update again.
Docker
With the Docker variant, run this next to the docker-compose.yml:
docker compose pull && docker compose up -d
update
Im Gast als root:
update
Der Ablauf:
- Aktuellen Stand von iac-core und App nach
/var/lib/iac/src/laden. - Debian-Pakete per
full-upgradeinnerhalb der Debian-Version aktualisieren. Eigene Konfigurationsänderungen bleiben erhalten. Reste entfernter Pakete werden bereinigt, Datenbankdaten nicht. Der nächtliche Lauf startet Dienste neu, die noch ersetzte Bibliotheken verwenden; beim manuellen Lauf werden sie nur aufgelistet. - Zielzustand für App-Version, Module, Konfiguration und Firewall herstellen. Ein Dienst startet nur neu, wenn sich eine seiner Abhängigkeiten geändert hat.
- Dienste und Erreichbarkeit prüfen,
/etc/iac/instance.jsonschreiben.
etckeeper erfasst /etc vor und nach dem Lauf. git -C /etc log zeigt die Änderungen. Ein nötiger Neustart wird gemeldet, aber niemals automatisch ausgelöst. Wiederholte Ausführung stellt denselben Zielzustand her.
Nächtliches Update
auto-update läuft um 02:00 Uhr und ist für neue Gäste vorausgewählt. Bei älteren Gästen mit update -am auto-update hinzufügen; mit update -rm auto-update entfernen.
systemctl list-timers iac-auto-update.timer
journalctl -u iac-auto-update
Jeder Lauf, auch ein Abbruch oder fehlgeschlagener Download, vermerkt das Ergebnis in /var/lib/iac/update.json:
{ "time": "2026-10-22T02:00:13Z", "status": "failed", "exit_code": 1 }
Details stehen in /var/log/iac/iac.log. Werkzeuge können JSON statt Logs auswerten. NetBox zeigt den Status pro Gast. Bei einem Fehler bleibt der Gast bestehen; Ursache und mögliche Teiländerungen im Log prüfen.
App-Versionen
- Apps aus Debian werden mit den Debian-Paketen aktualisiert.
- Die meisten Apps von GitHub, Codeberg oder npm sind auf eine Version festgelegt.
updateinstalliert die von haypack gebaute und boot-getestete Version. Neue Versionen werden nach bestandenen Tests angehoben; Hauptversionswechsel erfordern eine Prüfung. - Apps ohne feste Version folgen der neuesten Upstream-Version. Eine Hauptversionssperre wie bei Traefik begrenzt das auf die aktuelle Hauptversion; neue Hauptversionen werden nur gemeldet. Den Wechsel erklärt die App-Migrationsanleitung.
updateführt keine Downgrades durch. Manche Apps, darunter Traefik, rollen ein fehlgeschlagenes Update selbstständig zurück.
Optionen
| Befehl | Wirkung |
|---|---|
update | Normales Update |
update -lm, --list-modules | Nummerierte Modulliste; aktive Module mit ✓ |
update -am a,b, --add-modules | Module nach Name oder Nummer hinzufügen, z. B. update -am 1,3 |
update -rm a,b, --remove-modules | Module entfernen; Daten bleiben |
update --modules a,b | Modulauswahl vollständig setzen; '' bedeutet keine |
update --release-upgrade | Zur nächsten Debian-Version wechseln |
update -y | Ohne Rückfragen |
update -h, --help | Hilfe, Beispiele und wichtige Pfade |
| Umgebung | Wirkung |
|---|---|
IAC_OFFLINE=1 | Quellen aus /var/lib/iac/src/ verwenden, nichts herunterladen |
IAC_CORE_REF, IAC_APP_REF | Anderen Branch oder Tag zum Testen verwenden |
IAC_VERBOSE=1 | Ergebnisse aller Ansible-Aufgaben anzeigen |
Neue Debian-Version
haypack wechselt Debian-Versionen nie selbstständig. Sobald die nächste Version stabil ist:
update --release-upgrade
Der Ablauf prüft den Status stable und freien Speicher und stellt danach den Zielzustand her. Vorher ein Backup oder einen Proxmox-Snapshot erstellen.
Wenn update fehlschlägt
tail -n 100 /var/log/iac/iac.log
IAC_VERBOSE=1 update
bash /var/lib/iac/src/core/bin/iac-smoke
Zuerst die Ursache beheben, etwa Netzwerk, Speicherplatz oder eine fehlerhafte lokale Datei. Danach update erneut ausführen, um den Zielzustand wiederherzustellen.
Docker
Im Verzeichnis der docker-compose.yml:
docker compose pull && docker compose up -d