Files
Jack Carter bbea38eae0 fix: heal DNS nameserver group domains=null state on apply
A self-hosted NetBird dashboard crashed when loading the DNS → Nameservers
page because the installer-default "Public DNS" nameserver group was stored
with `domains: null` and the dashboard frontend does not null-guard that
field. The collection's apply cycle was preserving the null state rather
than healing it.

Four layers of fix:

- roles/export/templates/export/dns/nameservers.yml.j2 — always emit
  `domains: []` on export instead of omitting the key when the API
  returned null. Ensures the exported YAML carries an explicit list
  into the apply cycle.

- roles/configure/tasks/main.yml — coerce `item.domains is null` to
  `[]` via `default([], true)` before passing to the module, so that
  a hand-edited YAML with `domains: null` still produces `[]`.

- plugins/module_utils/netbird_api.py — `update_nameserver_group` now
  always includes `domains` in the PUT body and coerces `None → []`.
  Previously it skipped the field on `None`, which preserved the
  backend's null state.

- plugins/modules/netbird_dns.py — `nsgroup_needs_update` now treats
  backend `domains: null` (or `groups: null`) as a heal-eligible change
  against a list-valued desired state, so a PUT fires to coerce the
  field. Previously it used `current.get('domains') or []` which
  silently equated null with [] and returned "no change".

With these together, a `make safe-apply-test` cycle heals the
installer-seeded null state, and the dashboard loads. Verified against
netbird.cybersunset.net.
2026-04-17 18:03:39 +02:00
..
2026-03-27 07:30:45 +01:00
2026-03-27 07:30:45 +01:00
2026-03-27 07:30:45 +01:00
2026-03-27 07:30:45 +01:00