Manifests
App Manifest
All fields of iac.json, the variables and helper roles of iac-core, tests, CI and common mistakes.
The App Manifest describes how an app declares its target state, resources, settings and ports. Its machine-readable definition is iac.json, alongside the Ansible role. The Core Manifest explains the execution model; the Security Manifest defines the shared security principles.
How an installation runs
Whichever way you come in – container, image build, first boot of a VM, update, adoption –
you end up at one playbook inside the guest:
flowchart LR
subgraph host["Proxmox host"]
ct["ct.sh"]
vm["vm.sh"]
end
subgraph guest["Guest – LXC, VM or image build"]
install["bin/iac-install<br/>ansible-playbook site.yml"]
update["update<br/>load iac-core + app → Debian upgrade"]
adopt["adopt.sh<br/>tasks/adopt_check.yml → backup"]
end
ct -- "pct exec" --> install
vm -- "ready image (chroot during the build, again on first boot)" --> install
update -- "iac_mode=update" --> install
adopt -- "iac_mode=adopt" --> installThe playbook site.yml runs these roles in order:
flowchart TD facts["iac_facts<br/>iac.json, instance, settings, secrets, modules"] base["iac_baseline<br/>SSH, base packages, base firewall rules, update"] mods["iac_modules<br/>PostgreSQL, Valkey, …"] app["YOUR APP – tasks/main.yml<br/>this is what you write"] fin["iac_finish<br/>handlers → firewall from ports → start services<br/>→ check health → /etc/iac/instance.json"] facts --> base --> mods --> app --> fin classDef yours stroke-width:3px class app yours
ct.sh, vm.sh and adopt.sh live in iac-core alone (entry/); the website serves them for each
app under the app’s name. adopt.sh exists as soon as the app has tasks/adopt_check.yml.
iac.json
| Field | Meaning |
|---|---|
name | lowercase letters, digits, -. The repository is called iac-<name>, the one-liners /<name>/ct.sh |
title, description | name and one sentence (English) for the website and the dialog |
category | category in the catalog: ai, automation, database, development, documentation, games, helpdesk, infrastructure, networking, security or web |
tags | keywords for search and filters, lowercase with -, e.g. ["dns", "ad-blocking"] |
website | project website of the software |
upstream | where the version comes from: {"type": "debian", "repo": "<package>"}, {"type": "apt", "repo": "<package>"} (third-party repository iac-core/apt/<package>.sources, e.g. Zammad), {"type": "github-release", "repo": "<owner/repo>"}, {"type": "codeberg-release", "repo": "<owner/repo>"} (releases on codeberg.org, e.g. Forgejo), {"type": "forgejo-release", "repo": "<owner/repo>", "url": "https://<host>"} (releases on another Forgejo, e.g. Fabulous Dash), {"type": "npm", "repo": "<package>"}, {"type": "url", "url": "https://…"} (first line = version; for a JSON API add "jq": "<filter>", e.g. Factorio) or {"type": "other", "version": "…"}. With "major_lock": true, update stays in the installed major version. "version" next to github-release, codeberg-release, forgejo-release or npm pins the tested version (versions) |
supports | lxc, vm (with VM image), docker (with docker-compose.yml in the repository) |
debian_components | contrib, non-free – Debian components in addition to main and non-free-firmware, only for packages that live there (e.g. unrar, SABnzbd). Every other guest stays on main |
defaults | resources per platform: cpu, ram (MiB, at least 512), disk (GiB). The boot test uses the VM RAM (at most 2.5 GiB) |
image.size | size of the root partition in the VM image, e.g. "8GiB" (default 3GiB); the disk grows when the guest is created |
ports | the firewall is built from this: port, proto (tcp/udp), description, access (public = everyone, private = private networks only) |
services | systemd units of the app: iac-core enables and starts them, the smoke test checks them |
tls | reload: systemd units that reload after a new certificate in /etc/iac/tls/ (TLS certificates) |
health | url that must answer after every installation; status = allowed HTTP codes (default [200]) |
secrets | generated once per instance, never in the image: a name or {"name": …, "length": 32} → iac_settings.<name> |
settings | settings when creating the guest (var_<name>): name, title, description, secret → iac_settings.<name> |
modules | only what the app needs: text = required module, {"name": …, "default": true} = preselected, "default": false withdraws a preselection of the catalog (e.g. auto-update). All other modules can be chosen anyway (modules) |
adopt.backup | paths adopt.sh backs up before the adoption |
access | hint after creating the guest, {ip} is replaced |
icon | logo on the website: slug at selfh.st/icons, homelab-svg-assets or dashboard-icons (also games), tried in this order (default: name); {"dashboard": "<slug>"} takes only that source |
hidden | true = doesn’t appear on the website |
tls WIP | planned, not in the schema yet: {"reload": ["nginx"]} – services that reload after a new certificate (TLS certificates) |
The complete schema:
iac-core/schema/iac.schema.json.
Variables
iac-core sets these variables for your tasks to read:
| Variable | Content |
|---|---|
iac_build | true in the image build (chroot: no service runs, no secrets, no database) |
iac_mode | install, update or adopt |
iac_platform | lxc or vm |
iac_deploy_type | lxc, vm or adopted |
iac_adopt_backup | false with adopt.sh --no-backup, otherwise true |
iac_settings | settings and secrets of the instance, e.g. iac_settings.myapp_db_password |
iac_modules_active | active modules |
iac_json | the whole iac.json |
iac_app_version_pin | version the image build asks for (otherwise empty) |
iac_upstream_latest | latest version according to upstream (only queried when needed) |
Each one is explained in the header of
iac-core/ansible/site.yml.
Versions
Debian packages: with "upstream": {"type": "debian", "repo": "<package>"} iac-core works out
the version itself – nothing to do in the app.
Everything else (GitHub release, own download page): the role iac_version decides what gets
installed. All you tell it is how to read the installed version:
- name: Version to install
ansible.builtin.include_role:
name: iac_version
vars:
iac_version_command: /usr/local/bin/myapp --version
iac_version_regex: 'v?([0-9.]+)' # optional: first group = version
- name: "Install myapp {{ iac_version_target }}"
when: iac_version_target != iac_version_installed
block:
- name: Download (checksum from the release)
ansible.builtin.get_url:
url: "https://github.com/vendor/myapp/releases/download/v{{ iac_version_target }}/myapp.tar.gz"
dest: /tmp/myapp.tar.gz
checksum: "sha256:https://github.com/vendor/myapp/releases/download/v{{ iac_version_target }}/SHA256SUMS"
mode: "0644"
# … unpack, install, notify: Restart myapp
| Situation | iac_version_target |
|---|---|
| not installed | the image’s version (iac_app_version_pin) or the latest |
update (and adoption) | the latest if it’s newer – with "major_lock": true only within the major version, a new major version is reported |
| otherwise | the installed one |
Two things are mandatory:
- Checksum:
checksum:with the release’s checksum file. No checksum, no download. If a project doesn’t publish any, sort that out before building the app. - Only install on a new version:
when: iac_version_target != iac_version_installed, file to/tmpand delete it afterwards. Withoutchecksum,get_urldoesn’t download an existing file again – a fixed target like/var/cache/myapp.tar.gzwould unpack the old archive on everyupdate.
Pinned version: with "version" next to github-release, codeberg-release, forgejo-release
or npm
(e.g. {"type": "codeberg-release", "repo": "forgejo/forgejo", "version": "17.0.0"}) “the latest”
in the table means that version – installation, image and update all get the version that passed
the CI, not the newest upstream release. Raising it is a commit to the app: Renovate (iac-core
renovate/config.js) opens a pull request, image.yml builds and boot-tests its branch, minor and
patch updates are merged when green, major updates wait for a review. Write the pin in the order
{"type": …, "repo": …, "version": …} – Renovate finds it with a regex, lint.sh checks it.
update
never goes back to a lower pin, and with "major_lock": true an instance on another major version
stays where it is. Without "version" the latest upstream release is asked live.
iac_version_installed stays empty until something is installed. The role records the version in
instance.json on its own. Examples: iac-traefik (binary, update with rollback), iac-netbox
(release
per directory), iac-ai-workstation.
Helper roles
Enable and start a service, also in the image build (there only enable):
- ansible.builtin.include_role:
name: iac_service
vars:
iac_service: myapp-worker
You don’t need this for the services in services – iac-core starts those itself.
Database: postgresql in modules, then:
- name: Database
ansible.builtin.include_role:
name: postgresql
tasks_from: database
vars:
postgresql_db: myapp
postgresql_user: myapp
postgresql_password: "{{ iac_settings.myapp_db_password }}"
when: not iac_build
Prefer MariaDB? Use the module mariadb, tasks_from: database with mariadb_db,
mariadb_user and mariadb_password.
Servarr apps (Prowlarr, Sonarr, Radarr, …): the whole app is one include – download with
checksum, version switch, sandboxed unit, config.xml with API key and form login, and the user
admin created over the API:
- ansible.builtin.include_role:
name: iac_servarr
vars:
servarr_app: sonarr
servarr_name: Sonarr
servarr_port: 8989
servarr_api: v3
servarr_asset: "Sonarr.main.{version}.linux-x64.tar.gz"
It needs "upstream": {"type": "github-release", …, "version": …}, the secrets
sonarr_admin_password and sonarr_api_key (length 32) and a handler Restart sonarr.
servarr_media: false for apps without media (Prowlarr).
TLS certificates
Most apps need no TLS of their own: their web interface sits behind a reverse proxy such as
Traefik, and the app speaks HTTP inside the network. Apps reached directly are the exception: they
serve TLS themselves with the helper role iac_tls of iac-core – never with their own
self-signed certificate.
- name: Certificate of the guest
ansible.builtin.include_role:
name: iac_tls
vars:
iac_tls_user: myapp # reads the key (group ssl-cert); leave out if the service runs as root
# then use iac_tls_cert and iac_tls_key in the configuration
The paths are always /etc/iac/tls/cert.pem and key.pem. Without a certificate of the
internal CA the role creates a self-signed one once, from the same key – the
app works the same in both cases. A certificate of the CA later only replaces cert.pem;
"tls": {"reload": [...]} in iac.json names the services that reload then. No key is created
in the image build – every instance gets its own on its first run.
Files in the guest
- What your tasks place with
copy/templatebelongs to haypack and is reconciled on every run. Such files start with# managed by iac – do not edit. - Changes by users go into files haypack doesn’t touch – plan a
localfile for that (iac-netbox:/etc/netbox/configuration.local.py). - You don’t need a firewall file – it’s built from
ports. - Secrets never go into the repository:
secretsiniac.json, in the template{{ iac_settings.name }}, tasks that use them getno_log: true.
First login
If the app has a login, it must be usable right after the installation:
- Password as a secret in
iac.json, e.g.{"name": "myapp_admin_password", "length": 24}. - The tasks create the first user with it, only as long as there’s no admin yet – haypack never
touches a changed password or your own admins.
no_log: true,when: not iac_build. accessnames the user and where to find the password; the app page (“Then:”) andct.shshow it:
"access": "Web: http://{ip}:8000/ – login: admin, password in the guest: grep myapp_admin_password /etc/iac/settings.env"
A setup wizard in the browser isn’t enough: whoever opens it first on the network decides the
admin, and often the service only listens on its ports after it – then the port check, smoke test
and boot test fail. Create a start configuration instead (force: false, so later changes stay)
that skips the wizard. Example: iac-netbox (netbox_admin_password).
Setup guide
Most apps are covered by their generated page: ports, settings and the access hint. When an app
needs steps outside the guest – a reverse proxy, DNS, port forwardings, clients – it brings a
setup guide: docs/GUIDE.md in the app repository. The website appends it to the app page as
“Setup guide”, with its sections in the sidebar.
- English, like the website. The German
README.mdstays short and links to it. - Sections as
##headings (they become the contents in the sidebar), no#title – the page has one. Write for the user of the app, not for its developer. - It lives next to the code on purpose: change it in the same commit as settings, ports or the layout it describes.
- No guide for apps the generated page explains completely.
Example: iac-netbird.
Smoke test
iac-core already checks instance.json, the services, health and the ports in the firewall.
tests/smoke.sh only contains what is specific to your app:
check "API answers" 'curl -fsS http://127.0.0.1:9090/api/health | jq -e .ok'
check "runs as its own user" 'ps -o user= -C myapp | grep -qx myapp'
tests/smoke.sh is not a script of its own: iac-smoke reads it with source. So no
shebang, no set -e, no exit – only check "description" 'command' (header as in the
template, # shellcheck shell=bash).
check never aborts: all checks run, failed ones show the command and its output. The same test
runs in the boot test of every image and by hand in the guest
(bash /var/lib/iac/src/core/bin/iac-smoke).
Adoption
| File | When | What |
|---|---|---|
tasks/adopt_check.yml | before the question | check – change nothing. Refuse with ansible.builtin.fail and a reason |
tasks/adopt.yml | after the question and the backup (adopt.backup), before tasks/main.yml | move existing data into the haypack layout |
Example: iac-traefik (adopts its own configuration as traefik.local.yaml). If it can’t be done
automatically, a guide belongs in docs/MIGRATION.md – the website links it.
Testing
Lint – typos, wrong fields, Ansible syntax, leftovers of old apps:
iac-core/tools/lint.sh iac-myapp
Without Proxmox – Docker container with systemd:
iac-core/tools/dev-container.sh iac-myapp # install + smoke test
iac-core/tools/dev-container.sh iac-myapp # again = like update
IAC_APP_VERSION=1.2.3 iac-core/tools/dev-container.sh iac-myapp # specific version
docker exec -e IAC_MODE=update iac-dev-myapp \
bash /var/lib/iac/src/core/bin/iac-install # update path of the app
The second run should show changed=1 (only instance.json) – if so, the app is idempotent. The
container isn’t a real LXC (privileged, no cloud-init), but it’s enough for the app logic.
On Proxmox – a branch, before it goes to main:
IAC_APP_REF=my-branch bash -c "$(curl -fsSL https://iac.heyer.systems/myapp/ct.sh)"
In the guest, IAC_VERBOSE=1 bash /var/lib/iac/src/core/bin/iac-install shows all task results.
CI
Every app ships identical workflows, each a single call. The steps live in iac-core
(ci/lint, ci/image):
| Workflow | When | What |
|---|---|---|
lint.yml | every push, every pull request | tools/lint.sh in a container |
image.yml | push to main and to renovate/…, Mondays | lint → build image → boot in QEMU → boot test incl. iac-smoke → publish → release (publish and release only on main) |
Images that fail the boot test are never published. Each published one becomes a release of
the app repository (tag = image version) with the upstream version, the commits since the previous
release and the checksum. Hostname and size of the image come from
iac.json. For more (additional bootstrap-vz settings) there’s the optional
image/manifest.yml.
Catalogs as JSON
The website also publishes all apps and modules in machine-readable form – for scripts, the iac-provisioner and coding agents:
| URL | Content |
|---|---|
/apps.json | every app: name, title, description, category, tags, supports, os (debian or haos – iac-core os.json), hidden, website, page (on this site), repo_url, upstream, modules_required, ports (port, proto, access) |
/modules.json | the module catalog of iac-core (modules.json, tag v2) |
curl -s https://iac.heyer.systems/apps.json | jq -r '.[] | "\(.name)\t\(.description)"'
Own modules
Anything several apps can use (database, cache, monitoring …) belongs in iac-core as a module, so any app can pick it up:
- Role
iac-core/ansible/roles/<module>/withmodule_state:presentinstalls and starts,absentremoves packages and files again – data stays. - Firewall rules of the module in
/etc/nftables.d/40-<module>.nft. - Entry in
iac-core/modules.json:title,description(English),supports(lxc,vm), optionallydefaultandicon(slug at selfh.st/icons, default: the module’s name). - A guide
iac-core/ansible/roles/<module>/GUIDE.md(English): what the module does, its settings in/etc/iac/settings.env, how to use and check it, what stays when it’s removed. It’s the module’s page on this website, andupdate -lmpoints to it – lint requires it.
A module for one app only lives in roles/<module>/ in the app repository. Structure and
examples:
iac-core/ansible/roles/README.md.
Common mistakes
| Symptom | Cause |
|---|---|
| Workflow never runs | file is in .forgejo/ instead of .forgejo/workflows/ |
Lint: module … does not exist | modules names a module that doesn’t exist (yet) |
Lint: … belongs to the old layout | app.func, packages.list or rootfs/ copied from an old app |
Lint: ct.sh is not used any more | old entry scripts in the repository – delete them, the website serves them |
Lint: category: … | category missing or not one of the list above |
| Image build aborts in the chroot | a service is started or a database is used – when: not iac_build |
Service restarts on every update | restart as a task instead of a handler with notify |
neither the role iac_version nor iac_app_version | app from outside Debian without the role iac_version |
Lint: iac.json doesn’t match the schema | e.g. "major_lock": 0 instead of true – fields exactly as in the schema |
update installs no new version | download to a fixed file without checksum – see versions |
| Port check fails after a fresh installation | service only listens after a setup wizard – see first login |
iac-smoke ends without a summary | set -e or exit in tests/smoke.sh – the file is sourced, an error then ends the whole test |
No VM image, vm.sh finds nothing | .forgejo/workflows/image.yml is missing or was changed – take the template |
Own changes gone after update | change in a managed by iac file instead of a local file |
item is undefined in a loop | loop over something that may be missing – set_fact first, then loop |
Ansible knowledge
What you get is ansible-core from Debian, meaning the ansible.builtin modules and no other
collections: documentation of the built-in
modules.
Das App-Manifest beschreibt Zielzustand, Ressourcen, Einstellungen und Ports einer App. Die maschinenlesbare Definition ist iac.json neben der Ansible-Rolle. Ausführungsmodell und Sicherheitsgrundlage erklären das Core-Manifest und das Security-Manifest.
Installationsablauf
Container, Image-Build, erster VM-Start, Update und Übernahme führen zum selben Playbook im Gast:
flowchart LR
subgraph host["Proxmox-Host"]
ct["ct.sh"]
vm["vm.sh"]
end
subgraph guest["Gast – LXC, VM oder Image-Build"]
install["bin/iac-install<br/>ansible-playbook site.yml"]
update["update<br/>iac-core und App laden → Debian aktualisieren"]
adopt["adopt.sh<br/>tasks/adopt_check.yml → backup"]
end
ct -- "pct exec" --> install
vm -- "Fertiges Image: chroot beim Build, erneut beim ersten Start" --> install
update -- "iac_mode=update" --> install
adopt -- "iac_mode=adopt" --> installsite.yml führt die Rollen in dieser Reihenfolge aus:
flowchart TD facts["iac_facts<br/>iac.json, Instanz, Einstellungen, Geheimnisse, Module"] base["iac_baseline<br/>SSH, Basispakete, Firewallgrundregeln, Update"] mods["iac_modules<br/>PostgreSQL, Valkey, …"] app["DEINE APP – tasks/main.yml<br/>Diesen Teil schreibst du"] fin["iac_finish<br/>Handler → Firewall aus Ports → Dienste starten<br/>→ Funktionstest → /etc/iac/instance.json"] facts --> base --> mods --> app --> fin classDef yours stroke-width:3px class app yours
Die Einstiegsskripte liegen ausschließlich in iac-core/entry/. Die Website liefert sie unter dem App-Namen aus. adopt.sh ist verfügbar, sobald tasks/adopt_check.yml existiert.
iac.json
| Feld | Bedeutung |
|---|---|
name | Kleinbuchstaben, Ziffern und Bindestriche. Repository iac-<name>, Einzeiler /<name>/ct.sh |
title, description | Name und englische Kurzbeschreibung für Website und Dialog |
category | ai, automation, database, development, documentation, games, helpdesk, infrastructure, networking, security oder web |
tags | Suchbegriffe in Kleinbuchstaben mit Bindestrichen, etwa ["dns", "ad-blocking"] |
website | Projektwebsite der Software |
upstream | Versionsquelle; Varianten siehe unten |
supports | lxc, vm mit Image, docker mit docker-compose.yml im Repository |
debian_components | Bei Bedarf contrib oder non-free zusätzlich zu main und non-free-firmware, etwa für unrar. Andere Gäste erhalten dadurch keine zusätzlichen Komponenten |
defaults | cpu, ram in MiB, mindestens 512, und disk in GiB pro Plattform. Boot-Test mit VM-RAM, höchstens 2,5 GiB |
image.size | Root-Partition im VM-Image, etwa 8GiB, Standard 3GiB; wächst beim Erstellen |
ports | Grundlage der Firewall: port, proto mit tcp/udp, description, access mit public/private |
services | systemd-Units, die iac-core aktiviert, startet und im Funktionstest prüft |
health | Zu prüfende url; erlaubte HTTP-Codes in status, standardmäßig [200] |
secrets | Einmal pro Instanz erzeugt, nicht im Image: Name oder Objekt mit name und etwa length: 32; Zugriff über iac_settings.<name> |
settings | Beim Erstellen per var_<name> übergebene Werte: name, title, description, secret; Zugriff über iac_settings.<name> |
modules | String = zwingendes Modul; Objekt mit name und default: true = Vorauswahl. default: false nimmt eine Katalogvorauswahl zurück. Weitere Module bleiben frei wählbar |
adopt.backup | Vor Übernahme zu sichernde Pfade |
access | Zugangshinweis nach Erstellung; {ip} wird ersetzt |
icon | Logo-Slug, zuerst selfh.st/icons, dann homelab-svg-assets und dashboard-icons; Standard App-Name. Objekt wie {"dashboard":"<slug>"} beschränkt die Quelle |
hidden | true blendet die App auf der Website aus |
tls | Geplantes Zertifikatsmodell: {"reload":["nginx"]} nennt nach Zertifikatswechsel neu zu ladende Dienste. Verfügbarkeit und Schema prüfen; siehe TLS |
Unterstützte Versionsquellen in upstream:
{"type":"debian","repo":"<package>"}für Debian-Pakete.{"type":"apt","repo":"<package>"}für verwaltete Fremdquellen ausiac-core/apt/<package>.sources.{"type":"github-release","repo":"<owner/repo>"}.{"type":"codeberg-release","repo":"<owner/repo>"}, etwa Forgejo.{"type":"forgejo-release","repo":"<owner/repo>","url":"https://<host>"}für andere Forgejo-Instanzen.{"type":"npm","repo":"<package>"}.{"type":"url","url":"https://…"}: erste Zeile ist die Version; JSON-APIs ergänzen"jq":"<filter>".{"type":"other","version":"…"}für sonstige Angaben.
major_lock: true hält Updates innerhalb der installierten Hauptversion. version bei GitHub-, Codeberg-, Forgejo-Releases oder npm legt die getestete Version fest.
Maßgeblich ist das vollständige Schema.
Variablen
| Variable | Inhalt |
|---|---|
iac_build | Im Image-Build true; chroot ohne Dienste, Geheimnisse und Datenbank |
iac_mode | install, update oder adopt |
iac_platform | lxc oder vm |
iac_deploy_type | lxc, vm oder adopted |
iac_adopt_backup | Bei Übernahme mit --no-backup false, sonst true |
iac_settings | Instanzeinstellungen und Geheimnisse |
iac_modules_active | Aktive Module |
iac_json | Vollständige App-Definition |
iac_app_version_pin | Vom Image-Build angeforderte Version, sonst leer |
iac_upstream_latest | Bei Bedarf abgefragte aktuelle Upstream-Version |
Weitere Erklärungen im Kopf von ansible/site.yml.
Versionen
Für Debian-Pakete ermittelt iac-core die Version selbst. Bei anderen Quellen entscheidet iac_version. Die App gibt an, wie ihre installierte Version ausgelesen wird:
- name: Version to install
ansible.builtin.include_role:
name: iac_version
vars:
iac_version_command: /usr/local/bin/myapp --version
iac_version_regex: 'v?([0-9.]+)' # optional: first group = version
- name: "Install myapp {{ iac_version_target }}"
when: iac_version_target != iac_version_installed
block:
- name: Download (checksum from the release)
ansible.builtin.get_url:
url: "https://github.com/vendor/myapp/releases/download/v{{ iac_version_target }}/myapp.tar.gz"
dest: /tmp/myapp.tar.gz
checksum: "sha256:https://github.com/vendor/myapp/releases/download/v{{ iac_version_target }}/SHA256SUMS"
mode: "0644"
# … unpack, install, notify: Restart myapp
| Situation | Zielversion |
|---|---|
| Noch nicht installiert | Image-Vorgabe iac_app_version_pin oder neueste Version |
| Update oder Übernahme | Neuere verfügbare Version; mit major_lock nur innerhalb der Hauptversion. Neuer Hauptversionsstand wird gemeldet |
| Sonst | Installierte Version |
Zwei Regeln sind verpflichtend:
- Prüfsumme:
checksum:mit der Prüfsummendatei des Releases. Ohne veröffentlichte Prüfsumme zuerst die Bezugsquelle klären. - Installation nur bei Versionswechsel:
when: iac_version_target != iac_version_installed. Archiv nach/tmpladen und danach entfernen. Ein fester Cachepfad ohne Prüfsumme kann dazu führen, dassget_urleine vorhandene Datei nicht erneut lädt und Updates das alte Archiv entpacken.
Eine festgelegte version bedeutet in der Tabelle die getestete Version, nicht den neuesten Upstream-Stand. Renovate aus iac-core/renovate/config.js öffnet einen Pull Request; image.yml baut und boot-testet den Branch. Minor- und Patch-Updates werden bei erfolgreichen Tests übernommen, Hauptversionen nach Review. Schreibreihenfolge type, repo, version einhalten: Renovate verwendet einen regulären Ausdruck, Lint prüft das.
update wechselt nie auf einen niedrigeren Pin. Eine Instanz auf anderer Hauptversion bleibt bei major_lock dort. Ohne version wird Upstream live abgefragt. iac_version_installed bleibt bis zur Installation leer; die Rolle schreibt den Stand selbst in instance.json. Beispiele sind iac-traefik mit Rollback, iac-netbox mit Releaseverzeichnissen und iac-ai-workstation.
Hilfsrollen
Dienst aktivieren und starten, im Image-Build nur aktivieren:
- ansible.builtin.include_role:
name: iac_service
vars:
iac_service: myapp-worker
Für Einträge in services ist das nicht nötig; iac-core startet sie selbst.
Datenbank: postgresql in modules, dann:
- name: Database
ansible.builtin.include_role:
name: postgresql
tasks_from: database
vars:
postgresql_db: myapp
postgresql_user: myapp
postgresql_password: "{{ iac_settings.myapp_db_password }}"
when: not iac_build
Für MariaDB entsprechend mariadb, tasks_from: database und die Variablen mariadb_db, mariadb_user, mariadb_password verwenden.
Servarr-Apps: Ein Include übernimmt Download mit Prüfsumme, Versionswechsel, Sandbox-Unit, config.xml mit API-Schlüssel und Formularanmeldung sowie den Admin-Benutzer über die API:
- ansible.builtin.include_role:
name: iac_servarr
vars:
servarr_app: sonarr
servarr_name: Sonarr
servarr_port: 8989
servarr_api: v3
servarr_asset: "Sonarr.main.{version}.linux-x64.tar.gz"
Benötigt werden eine GitHub-Release-Quelle mit Versions-Pin, sonarr_admin_password, sonarr_api_key mit Länge 32 und ein Handler Restart sonarr. Bei Apps ohne Medien, etwa Prowlarr, servarr_media: false setzen.
TLS-Zertifikate
Meist spricht eine App intern HTTP hinter einem TLS-Reverse-Proxy wie Traefik. Direkt erreichbare Apps sollen die Hilfsrolle iac_tls statt eigener Zertifikatslogik nutzen. Der geplante Stand ist auf der CA-Seite gekennzeichnet.
- name: Certificate of the guest
ansible.builtin.include_role:
name: iac_tls
vars:
iac_tls_user: myapp # reads the key (group ssl-cert); leave out if the service runs as root
# then use iac_tls_cert and iac_tls_key in the configuration
Die Pfade sind /etc/iac/tls/cert.pem und key.pem. Ohne interne CA erzeugt die Rolle einmal ein selbst signiertes Zertifikat aus demselben Schlüssel. Später ersetzt das CA-Zertifikat nur cert.pem; tls.reload nennt neu zu ladende Dienste. Im Image entstehen keine privaten Schlüssel; jede Instanz erzeugt ihren eigenen beim ersten Lauf.
Dateien im Gast
- Mit copy/template verwaltete Dateien werden bei jedem Lauf abgeglichen und beginnen mit
# managed by iac – do not edit. - Benutzeränderungen gehören in eine vorgesehene lokale Datei, etwa
/etc/netbox/configuration.local.py. - Keine eigene Firewall-Datei für die App: Die Regeln entstehen aus
ports. - Geheimnisse stehen nicht im Repository. In Templates
{{ iac_settings.name }}verwenden; Aufgaben mit Geheimnissen erhaltenno_log: true.
Erste Anmeldung
Apps mit Anmeldung müssen direkt nach der Installation nutzbar sein:
- Admin-Passwort als Secret, etwa
{"name":"myapp_admin_password","length":24}. - Ersten Benutzer nur erstellen, solange noch kein Admin existiert. Geänderte Passwörter und eigene Admins bleiben unangetastet.
no_log: trueundwhen: not iac_buildverwenden. accessnennt Benutzer und Passwortfundort. App-Seite und Einzeiler zeigen den Hinweis:
"access": "Web: http://{ip}:8000/ – login: admin, password in the guest: grep myapp_admin_password /etc/iac/settings.env"
Ein offener Setup-Assistent reicht nicht: Der erste Aufrufer könnte den Admin bestimmen; teilweise werden Ports erst danach geöffnet, wodurch Port-, Smoke- und Boot-Test fehlschlagen. Stattdessen eine Startkonfiguration mit force: false erzeugen, die den Assistenten überspringt und spätere Änderungen erhält. Beispiel: iac-netbox mit netbox_admin_password.
Einrichtungsanleitung
Generierte Seiten erklären Ports, Einstellungen und Zugang. Weitere Schritte außerhalb des Gasts – Proxy, DNS, Portweiterleitungen, Clients – stehen in docs/GUIDE.md im App-Repository und werden als Setup guide angehängt.
- Der technische Quelltext bleibt Englisch; das kurze deutsche README verlinkt darauf.
- Abschnitte mit
##, kein zusätzlicher H1-Titel. Für App-Nutzer schreiben, nicht für Entwickler. - Änderungen an Einstellungen, Ports und Layout im selben Commit in der Anleitung nachführen.
- Keine zusätzliche Anleitung, wenn die generierte Seite alles erklärt.
Beispiel: NetBird.
Funktionstest
iac-core prüft bereits instance.json, Dienste, Health-Endpunkt und Firewallports. tests/smoke.sh ergänzt nur App-spezifische Prüfungen:
check "API answers" 'curl -fsS http://127.0.0.1:9090/api/health | jq -e .ok'
check "runs as its own user" 'ps -o user= -C myapp | grep -qx myapp'
Die Datei ist kein eigenständiges Skript, sondern wird mit source eingelesen: kein Shebang, kein set -e, kein exit. Nur check "Beschreibung" 'Befehl', mit Vorlagenkopf # shellcheck shell=bash. Alle Prüfungen laufen durch; bei Fehlern erscheinen Befehl und Ausgabe. Derselbe Test läuft beim Image-Boot und manuell über bash /var/lib/iac/src/core/bin/iac-smoke.
Übernahme
| Datei | Zeitpunkt | Aufgabe |
|---|---|---|
tasks/adopt_check.yml | Vor der Rückfrage | Nur prüfen, nichts ändern. Nicht unterstützte Zustände mit ansible.builtin.fail und Begründung ablehnen |
tasks/adopt.yml | Nach Rückfrage und Sicherung aus adopt.backup, vor tasks/main.yml | Bestehende Daten in das haypack-Layout verschieben |
Beispiel: iac-traefik übernimmt bestehende Einstellungen als traefik.local.yaml. Für nicht automatisch übernehmbare Installationen eine docs/MIGRATION.md bereitstellen; die Website verlinkt sie.
Testen
Lint: Schreibfehler, Schema, Ansible-Syntax und alte App-Strukturen:
iac-core/tools/lint.sh iac-myapp
Ohne Proxmox: Docker-Container mit systemd:
iac-core/tools/dev-container.sh iac-myapp # install + smoke test
iac-core/tools/dev-container.sh iac-myapp # again = like update
IAC_APP_VERSION=1.2.3 iac-core/tools/dev-container.sh iac-myapp # specific version
docker exec -e IAC_MODE=update iac-dev-myapp \
bash /var/lib/iac/src/core/bin/iac-install # update path of the app
Der zweite Lauf soll changed=1 zeigen, ausschließlich für instance.json. Der privilegierte Testcontainer ist kein echtes LXC und hat kein cloud-init, prüft aber die App-Logik. Der Versionsparameter testet eine ältere Installation; der anschließende Update-Lauf muss tatsächlich auf die Zielversion wechseln.
Auf Proxmox: Vor main einen Branch testen:
IAC_APP_REF=my-branch bash -c "$(curl -fsSL https://iac.heyer.systems/myapp/ct.sh)"
Im Gast zeigt IAC_VERBOSE=1 bash /var/lib/iac/src/core/bin/iac-install alle Aufgabenergebnisse.
CI
Alle Apps verwenden identische Workflows mit einem Aufruf; Schritte liegen in iac-core/ci/lint und ci/image.
| Workflow | Auslöser | Ablauf |
|---|---|---|
| lint.yml | Jeder Push und Pull Request | Lint im Container |
| image.yml | Main, renovate-Branches und montags | Lint, Image bauen, QEMU-Start, Boot-Test mit iac-smoke. Veröffentlichung und Release nur auf main |
Fehlgeschlagene Boot-Tests verhindern eine Image-Veröffentlichung. Jedes veröffentlichte Image erhält einen Release mit Image-Version als Tag, Upstream-Version, Änderungen seit dem letzten Release und Prüfsumme. Hostname und Image-Größe stammen aus iac.json; zusätzliche bootstrap-vz-Einstellungen können in image/manifest.yml stehen.
JSON-Kataloge
Die Website veröffentlicht maschinenlesbare Kataloge für Skripte, Provisioner und Coding-Agenten:
| URL | Inhalt |
|---|---|
| /apps.json | App-Name, Titel, Beschreibung, Kategorie, Tags, Plattformen, Betriebssystem os (debian oder haos – iac-core os.json), hidden, Website, Seiten- und Repository-URL, Upstream, Pflichtmodule und Ports mit port/proto/access |
| /modules.json | Modulkatalog aus iac-core mit Tag v2 |
curl -s https://iac.heyer.systems/apps.json | jq -r '.[] | "\(.name)\t\(.description)"'
Eigene Module
Gemeinsam nutzbare Funktionen wie Datenbanken, Cache und Monitoring gehören als Modul nach iac-core:
- Rolle
iac-core/ansible/roles/<module>/mitmodule_state: present installiert und startet; absent entfernt Pakete und Dateien, Daten bleiben. - Firewallregeln in
/etc/nftables.d/40-<module>.nft. - Katalogeintrag in
iac-core/modules.json: englische title/description, supports mit lxc/vm, optional default und icon-Slug; Standard ist der Modulname. - Englische
GUIDE.mdneben der Rolle: Zweck, Einstellungen in settings.env, Nutzung, Prüfung und nach Entfernung verbleibende Daten. Daraus entsteht die Modulseite; Lint verlangt sie und update -lm verlinkt sie.
App-interne Module liegen dagegen in roles/<module>/ im App-Repository. Beispiele und Struktur: Rollen-README.
Häufige Fehler
| Symptom | Ursache |
|---|---|
| Workflow startet nicht | Unter .forgejo/ statt .forgejo/workflows/ abgelegt |
| Modul existiert nicht | Katalogeintrag fehlt |
| „belongs to the old layout“ | Alte app.func, packages.list oder rootfs übernommen |
| „ct.sh is not used any more“ | Alte Einstiegsskripte im App-Repository; die Website liefert sie |
| Kategoriefehler | category fehlt oder ist nicht zulässig |
| Image-Build bricht im chroot ab | Dienststart oder Datenbankzugriff ohne when: not iac_build |
| Dienst startet bei jedem Update neu | Neustart als Aufgabe statt notify/Handler |
| „neither the role iac_version nor iac_app_version“ | Nicht-Debian-App ohne iac_version |
| Schemafehler | Falscher Typ, etwa major_lock als 0 statt true |
| Keine neue Version | Fester Downloadpfad ohne checksum; siehe Versionen |
| Portprüfung nach Installation fehlerhaft | Dienst braucht noch einen Setup-Assistenten |
| Smoke-Test ohne Zusammenfassung | set -e oder exit beendet die eingebundene Datei vorzeitig |
| VM-Image fehlt | image.yml fehlt oder weicht von der Vorlage ab |
| Eigene Änderungen verschwunden | Verwaltete statt lokale Datei geändert |
| „item is undefined“ | Schleife über möglicherweise fehlende Daten; erst set_fact, dann loop |
Ansible-Wissen
Verwendet wird ansible-core aus Debian mit eingebauten Modulen, ohne zusätzliche Collections. Referenz: ansible.builtin.