1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fix nsupdate when updating NS record (#5112) (#5131)

* Fix nsupdate when updating NS record

* Changelog fragment

* Update changelogs/fragments/5112-fix-nsupdate-ns-entry.yaml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Switch to fallback to AUTHORITY instead of using with NS type.

* Update plugins/modules/net_tools/nsupdate.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/net_tools/nsupdate.py

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: jonathan lung <lungj@heresjono.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit ad8965218d)

Co-authored-by: Jonathan Lung <lungj@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2022-08-20 13:34:16 +02:00 committed by GitHub
parent 37fc85b03a
commit 465b0c72a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- nsupdate - compatibility with NS records (https://github.com/ansible-collections/community.general/pull/5112).

View file

@ -426,6 +426,9 @@ class RecordManager(object):
if lookup.rcode() != dns.rcode.NOERROR:
self.module.fail_json(msg='Failed to lookup TTL of existing matching record.')
if self.module.params['type'] == 'NS':
current_ttl = lookup.answer[0].ttl if lookup.answer else lookup.authority[0].ttl
else:
current_ttl = lookup.answer[0].ttl
return current_ttl != self.module.params['ttl']