heyer.systems Open Source

Use

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:

  1. Load the current state of iac-core and the app (to /var/lib/iac/src/).
  2. Update the Debian packages (full-upgrade within 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.
  3. Establish the target state: app version, modules, configuration, firewall. A service restarts only if something it depends on changed.
  4. 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 between 02:00 and 02:30 (each guest at its own fixed time) 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 iac – 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: update installs the version iac 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.
  • update never downgrades. Some apps, Traefik among them, roll back by themselves if their update fails.
  • If the upstream or the package repository of an app doesn’t answer, update warns and the app stays at its version – Debian and the rest are still updated; the next run tries again. A broken repository (e.g. an expired key) still fails the run.

Options

CommandEffect
updatenormal update
update --checkis the installed iac-core the current one of its ref? Prints current, behind or unknown (guests from before this option); installs nothing
update -lm, --list-modulesmodules for this guest as a numbered table, active ones with ✓
update -am a,b, --add-modulesadd modules, by name or number (update -am 1,3, modules)
update -rm a,b, --remove-modulesremove modules, data stays
update --modules a,bset the module selection ('' = none)
update --release-upgrademove to the next Debian release
update --core-ref v3, --app-ref <branch>load iac-core or the app from this branch or tag from now on
update -yno questions
update -h, --helphelp with all options, examples and important files
EnvironmentEffect
IAC_OFFLINE=1use the sources in /var/lib/iac/src/, download nothing
IAC_CORE_REF, IAC_APP_REFanother branch or tag of iac-core or the app, for this run only (tests)
IAC_VERBOSE=1show every Ansible task result

New Debian release

iac 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