65 Commits
Author SHA1 Message Date
Tomas Kloda 552f765281 fixing missing sources in diff 2026-03-31 23:25:12 +02:00
Tomas Kloda ec2a4f1ec9 normalization 2026-03-31 23:08:46 +02:00
Tomas Kloda 98e1b98ce0 another debug 2026-03-31 23:04:59 +02:00
Tomas Kloda afd8b36897 adding debug 2026-03-31 23:00:12 +02:00
Tomas Kloda da74682398 fixing false diff 2026-03-31 22:49:24 +02:00
Tomas Kloda 8ae2a014ea use filter fqdn instead 2026-03-31 22:38:15 +02:00
Tomas KlodaandClaude Opus 4.6 148d0a5442 bump version to 1.2.0 for filter plugin support
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-31 22:32:58 +02:00
Tomas Kloda 4045d39929 moving to plugins 2026-03-31 22:20:40 +02:00
Tomas Kloda 1244c54e97 differ improvements 2026-03-31 21:55:54 +02:00
tklodaandGitHub 9552a480eb Merge pull request #24 from tkloda/peer_id_fix
fixing peer id handling
2026-03-31 21:32:19 +02:00
Tomas Kloda 0beba12fd6 fixing peer id handling 2026-03-31 21:31:03 +02:00
tklodaandGitHub ffbc26b3ff Merge pull request #22 from SunsetDrifter/feat/safe-apply-playbook
Add safe_apply_netbird playbook for backup-preview-apply workflow
2026-03-31 14:21:31 +02:00
tklodaandGitHub 5bc8f13763 Merge pull request #23 from SunsetDrifter/fix/dns-zone-sync-records-null-guard
Fix null guard for sync_records() in netbird_dns_zone
2026-03-31 14:21:21 +02:00
Jack Carter 38b8365a68 feat: add safe_apply_netbird playbook for backup-preview-apply workflow
New playbook that wraps the export and configure roles into a safe
IaC pipeline:

1. BACKUP  - exports current live state to timestamped backups/ dir
2. PREVIEW - shows read-only diff of what config changes would do
3. APPLY   - applies changes (gated behind -e apply=true)

Safety features:
- Preview-only by default (no changes without explicit opt-in)
- Automatic backup before any apply (relative to config_dir, not
  playbook_dir, so backups don't land inside the collection tree)
- Strict mode opt-in via -e use_strict=true
- Preview step skippable with -e preview=false to halve API calls
- Rollback by re-applying from a backup directory
- Input validation for required variables

Updated README Quick Start to recommend the safe workflow, and added
api_url clarification note.
2026-03-31 12:03:42 +02:00
Jack Carter 2e4efde08b fix: null guard sync_records() in netbird_dns_zone
list_dns_zone_records() returns null for zones with no records,
causing TypeError when iterating. Same pattern fixed in #20 for
other modules — this one was missed.
2026-03-31 11:59:11 +02:00
tklodaandGitHub 3b906fe499 Merge pull request #21 from SunsetDrifter/fix/preserve-fields-on-update
Preserve existing field values on partial updates
2026-03-31 11:47:34 +02:00
Jack Carter 6bf9c8134a docs: document partial update preservation behavior in README
Added notes and examples for netbird_group, netbird_setup_key, and
netbird_user explaining that omitting list fields (peers, auto_groups)
on update preserves existing values instead of clearing them.
2026-03-31 10:24:51 +02:00
Jack Carter 2041cd2d89 fix: preserve existing field values on partial updates
Changes module behavior so that omitting auto_groups, peers, or
similar list fields on update preserves the existing values instead
of wiping them to [].

Modules changed:
- netbird_setup_key: auto_groups default [] -> None, preserve on update
- netbird_group: peers default [] -> None, preserve on update,
  normalize peer dicts to IDs
- netbird_user: auto_groups default [] -> None, preserve on update

Also:
- Reimplement get_current_user() since /api/users/me does not exist.
  Now lists users and matches by is_current flag, with explicit error
  on multi-user deployments without the flag.
- Configure role: use default(omit) for setup key auto_groups so
  the module-level preservation works through the role.
- Configure role: conditional auto_groups resolution (skip when
  auto_groups not defined in YAML config).
- Configure role: DNS zone distribution_groups now handles both
  group names and raw IDs (falls back to original value when not
  found in group_ids map).
- Updated DOCUMENTATION strings to remove stale default: [] and
  document preservation behavior.
2026-03-30 21:21:28 +02:00
Jack Carter 5d85c3afef fix: null guard all API list iterations and fix role set_fact parsing
- Add (items or []) to all find_*_by_* functions across 12 modules.
  The NetBird API returns null for empty collections, causing TypeError
  when iterating. Affects find_group_by_name, find_policy_by_name,
  find_setup_key_by_name, find_user_by_email, find_user_by_name,
  find_network_by_name, find_route_by_network_id, find_nsgroup_by_name,
  find_zone_by_name, find_posture_check_by_name, find_idp_by_name,
  find_invite_by_email, find_token_by_name.

- Add (or []) to sync_routers and sync_resources in netbird_network
  for the same reason (new networks have null router/resource lists).

- Fix export role network enrichment: .get('json', []) does not work
  on Ansible uri module results. Changed to .json | default([]).

- Fix set_fact parsing in export and configure roles: {{ result | to_json }}
  produces a JSON string, not a list. Added | from_json so downstream
  loop directives receive proper lists (3 occurrences in configure,
  1 in export).

- Use urllib.parse.urlencode for query parameter encoding instead of
  raw f-string interpolation to prevent URL breakage with special chars.
2026-03-30 21:18:13 +02:00
tklodaandGitHub ccc4176153 Merge pull request #19 from tkloda/galaxy
update readme
2026-03-27 16:06:40 +01:00
Tomas Kloda 1250c6aee4 update readme 2026-03-27 16:06:13 +01:00
tklodaandGitHub feb61e813e Merge pull request #18 from tkloda/iac
loop optimization
2026-03-27 15:07:18 +01:00
Tomas Kloda b631208943 loop optimization 2026-03-27 15:06:26 +01:00
tklodaandGitHub e98f87e39a Merge pull request #17 from tkloda/iac
fixed comparison issue in other modules
2026-03-27 14:31:24 +01:00
Tomas Kloda c42857cdb6 fixed comparison issue in other modules 2026-03-27 14:30:41 +01:00