Files
computer-playbook/roles/svc-bkp-nfs-2-local/meta/services.yml
kevinveenbirkenbachandClaude Opus 5 6c13ea853e fix(svc-bkp-nfs-2-local): drop the variant without an export
Variant 1 pinned nfs-server enabled false, so the matrix deployed the role that backs up the NFS export on a host where no export exists. The unit's own guard then refused the run and the job died: 'ERROR: /srv/nfs missing; this host is expected to serve the NFS export', followed by 'Failed to start svc-bkp-nfs-2-local.12.0.0.infinito.nexus.service'.

The guard is right; the variant was not. The role declares run_after svc-storage-nfs-server and reads its source through lookup('nfs_export_base') -- the export is the subject of the backup, not an optional service. The sibling role shows the legitimate shape: svc-storage-nfs-server toggles its consumer nfs_backup, and the server survives either way.

With no variant left to carry the false polarity, nfs-server takes the exemption the coverage lint documents for exactly this case: flags whose group-derived value is a hard invariant that variants must never override.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-16 03:38:38 +02:00

27 lines
676 B
YAML

---
# nocheck: variants-coverage — the export is what this role backs up, so the false polarity has no variant to live in: without the server there is no /srv/nfs and the unit's own guard aborts.
nfs-server:
enabled: "{{ 'svc-storage-nfs-server' in group_names }}"
shared: "{{ 'svc-storage-nfs-server' in group_names }}"
bond: 1
nfs-2-local:
modes:
host:
enabled: true
compose:
enabled: false
swarm:
enabled: false
bond: 1
enabled: true
shared: true
provides: nfs_backup
run_after:
- svc-storage-nfs-server
lifecycle: beta
min_storage: 0GB
cpus: "0.5"
mem_reservation: "256m"
mem_limit: "512m"
pids_limit: 256