Commit Graph

13 Commits

Author SHA1 Message Date
Daniel Akulenok
2a501535c6 Remove options validation from argument_spec to allow any extra keys
- Remove 'options' from zones and records in argument_spec
- This prevents Ansible from pre-validating structure before module code runs
- Module now accepts any dict structure and filters to known keys in code
- Add proper validation of required fields in _filter_zone_config()
- Now truly allows arbitrary extra keys like 'comment', 'type', etc. without errors
2026-01-29 21:48:56 +01:00
Daniel Akulenok
2fcbcb2d99 Use code-level filtering instead of options_ignore_list for extra keys
- Add _filter_zone_config() function to extract only known keys from zone config
- Remove options_ignore_list from argument_spec as it's unreliable across Ansible versions
- Filter zones in main() before processing to allow any extra keys in YAML
- More reliable approach for ignoring extra metadata keys (comment, type, etc.)
2026-01-29 21:44:55 +01:00
Daniel Akulenok
9dc42d99c1 Add ignore_ns_records flag and support for extra keys in zones/records parameters
- Add ignore_ns_records flag (default: true) to automatically ignore NS records
- Add options_ignore_list to zones and records to allow extra keys (e.g., comment, type)
- Update documentation to reflect NS records are now ignored by default
- Add changelog entry for v1.3.3 release
2026-01-29 21:40:41 +01:00
Daniel Akulenok
5550a57777 Remove invalid supports_diff parameter (v1.3.2)
- AnsibleModule.__init__() does not accept supports_diff or supports_diff_mode
- Diff mode support is declared via attributes in DOCUMENTATION
- This was the actual root cause of the error
- Bump version to 1.3.2
2026-01-29 21:33:01 +01:00
Daniel Akulenok
5307eef1b7 Fix AnsibleModule supports_diff parameter (v1.3.1)
- Correct supports_diff_mode to supports_diff in nsupdate_zone.py
- This fixes: AnsibleModule.__init__() got an unexpected keyword argument 'supports_diff_mode'
- Bump version to 1.3.1
2026-01-29 21:29:52 +01:00
Daniel Akulenok
51a798b7ce refactor(core): remove ansible.utils.display dependency
Refactored verbose output to use standard Ansible logging patterns:
- Removed: from ansible.utils.display import Display
- Changed: self.display.vvv() → self.module.debug()
- Maintains verbosity levels with self.module._verbosity checks
- Reduces external dependencies
- Improves compatibility with standard Ansible execution

The module now logs zone changes (Added, Removed, Changed, Skipped)
using self.module.debug() which works with -v and -vv flags.
2026-01-29 21:24:07 +01:00
Daniel Akulenok
4843c71606 feat: show detailed changes with --diff flag
Some checks failed
Test Collection / Sanity Tests (Ansible devel) (push) Failing after 12s
Test Collection / Sanity Tests (Ansible stable-2.15) (push) Failing after 30s
Test Collection / Sanity Tests (Ansible stable-2.16) (push) Failing after 30s
Test Collection / Sanity Tests (Ansible stable-2.17) (push) Failing after 28s
Test Collection / Python Syntax Check (push) Successful in 6s
Test Collection / YAML and Ansible Lint (push) Successful in 11s
Test Collection / Build Collection (push) Failing after 8s
Test Collection / Documentation Check (push) Successful in 7s
Test Collection / Unit Tests (push) Successful in 6s
- Display specific record changes when --diff flag is used
- Add 'or self.module._diff' condition to all change logging
- Shows Added, Removed, Changed records with --diff (same as -v)
- Skipped records still only shown with -vv
- Provides detailed diff output without requiring -v flag
- Users can now see what changed with just --diff flag
2026-01-29 20:55:26 +01:00
Daniel Akulenok
b1f2d9f3a1 refactor: use Display class instead of module.log() per Ansible spec
- Import Display class from ansible.utils.display
- Initialize display instance in DNSZoneManager
- Replace all module.log() calls with display.vvv() and display.vvvv()
- Use display.vvv() for important actions (-v verbosity)
- Use display.vvvv() for skipped records (-vv verbosity)
- Follows Ansible Developer Guide standards for verbosity-based output
- Aligns with ansible-creator agents.md specification
2026-01-29 20:53:09 +01:00
Daniel Akulenok
23fd133bc0 refactor: use Ansible standard logging instead of verbose result dict
- Replace verbose_actions in result dict with module.log() calls
- Log per-record actions directly when verbosity >= 1:
  - Added, Removed, Changed actions logged with -v
  - Skipped (unchanged) records logged with -vv
- Remove verbose key from result['changes'] dict
- Simplify _format_diff() to work directly with changes dict
- Follows Ansible conventions for verbose output
- Output now goes to Ansible's logging system instead of result payload
2026-01-29 20:50:32 +01:00
Daniel Akulenok
d37d09b631 refactor: replace verbose flag with Ansible verbosity (-v) flag
- Remove custom 'verbose' parameter from module
- Use Ansible's built-in verbosity setting (module._verbosity)
- Verbose output now shown with -v, -vv, -vvv flags
- Add notes to DOCUMENTATION explaining -v flag usage
- Update all examples to remove verbose: true parameter
- Update all documentation to mention -v flag instead
- Simplifies module interface by leveraging Ansible conventions
2026-01-29 20:48:15 +01:00
Daniel Akulenok
4625f2cb1e docs: update all documentation to reflect v1.1.0 features
- Update all examples to show new defaults (ignore_dnssec_records, ignore_soa_records, validate_records)
- Add verbose output examples throughout documentation
- Show global dns_server parameter usage
- Remove all references to deprecated parallel_zones parameter
- Update QUICK_START.md with new best practices
- Update README.md with new feature descriptions
- Update module EXAMPLES with verbose flag and current defaults
- Update all example playbooks (nsupdate_zone_example.yml, sample_zone_format.yml)
- Simplify examples by relying on sensible defaults
2026-01-29 20:45:14 +01:00
Daniel Akulenok
4b4c579f8d feat: add ignore_soa_records and validate_records flags with comprehensive validation
- Add ignore_soa_records flag (default: true) to automatically ignore SOA records
- Add ignore_dnssec_records flag with default changed to true
- Add validate_records flag (default: true) with record value validation
- Implement _validate_record_values() method supporting:
  - IPv4/IPv6 address validation for A/AAAA records
  - FQDN validation for CNAME/MX/NS/PTR/SRV records
  - Text record acceptance for TXT/SPF records
- Add global dns_server parameter for shared server configuration
- Add verbose output with per-record action tracking
- Add diff mode support for --diff flag
2026-01-29 20:31:01 +01:00
Daniel Akulenok
0142f806c9 First commit 2026-01-29 11:05:17 +01:00