-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nsupdate-module fails If nothing has to be changed #836
Comments
I dug deeper in and it seems to be this function: def ttl_changed(self):
query = dns.message.make_query(self.fqdn, self.module.params['type'])
try:
if self.module.params['protocol'] == 'tcp':
lookup = dns.query.tcp(query, self.module.params['server'], timeout=10, port=self.module.params['port'])
else:
lookup = dns.query.udp(query, self.module.params['server'], timeout=10, port=self.module.params['port'])
except (socket_error, dns.exception.Timeout) as e:
self.module.fail_json(msg='DNS server error: (%s): %s' % (e.__class__.__name__, to_native(e)))
current_ttl = lookup.answer[0].ttl
return current_ttl != self.module.params['ttl'] as a workaround I did the following, to disable the check: def ttl_changed(self):
return False than everything seems to be working again |
Hallo @fabianseelbach I am taking a look at this issue, but the line numbering between your traceback and I will continue investigating here regardless of that, but it would help making us sure we're looking at the right thing. |
The error indeed happens in that one specific line: current_ttl = lookup.answer[0].ttl Being an |
@russoz thanks for taking the issue. |
We are seeing the same issue for A records when using |
I ran into this again today using Ansible 2.9.22 |
@fabianseelbach are you using this collection with Ansible 2.9, or are you using the module included in Ansible 2.9? |
@felixfontein the module included in the package distributed by Red Hat |
@fabianseelbach what do you mean by "the package distributed by Red Hat"? If you are using Ansible 2.9, are you using FQCNs (community.general.nsupdate) or not? Or are you using Ansible >= 2.10, or ansible-base/ansible-core (see output of |
@felixfontein Sorry for the confusion.
|
In that case, please note that the Ansible verion you are using only receives security fixes anymore, so this problem won't get fixed there. You will have to start using the community.general collection if you want an updated version of this module. (Though that problem needs to get fixed here first for that to actually make a difference :) ) |
Thanks, I am aware of that. I'm currently in the transition to collections. |
Fix a possible `list index out of range` when no answer is returned in the `ttl_changed` method by applying the existing workaround for NS records to all records types. Resolves ansible-collections#836
Fix a possible `list index out of range` when no answer is returned in the `ttl_changed` method by applying the existing workaround for NS records to all record types. Resolves ansible-collections#836
Fix a possible `list index out of range` when no answer is returned in the `ttl_changed` method by applying the existing workaround for NS records to all record types. Resolves ansible-collections#836
…7219) * nsupdate: fix 'index out of range' error when no TTL answer is given Fix a possible `list index out of range` when no answer is returned in the `ttl_changed` method by applying the existing workaround for NS records to all record types. Resolves #836 * fixup! nsupdate: fix 'index out of range' error when no TTL answer is given
…7219) * nsupdate: fix 'index out of range' error when no TTL answer is given Fix a possible `list index out of range` when no answer is returned in the `ttl_changed` method by applying the existing workaround for NS records to all record types. Resolves #836 * fixup! nsupdate: fix 'index out of range' error when no TTL answer is given (cherry picked from commit 208df2c)
…7219) * nsupdate: fix 'index out of range' error when no TTL answer is given Fix a possible `list index out of range` when no answer is returned in the `ttl_changed` method by applying the existing workaround for NS records to all record types. Resolves #836 * fixup! nsupdate: fix 'index out of range' error when no TTL answer is given (cherry picked from commit 208df2c)
…nge' error when no TTL answer is given (#7235) nsupdate: fix 'index out of range' error when no TTL answer is given (#7219) * nsupdate: fix 'index out of range' error when no TTL answer is given Fix a possible `list index out of range` when no answer is returned in the `ttl_changed` method by applying the existing workaround for NS records to all record types. Resolves #836 * fixup! nsupdate: fix 'index out of range' error when no TTL answer is given (cherry picked from commit 208df2c) Co-authored-by: Silke Hofstra <[email protected]>
…nge' error when no TTL answer is given (#7236) nsupdate: fix 'index out of range' error when no TTL answer is given (#7219) * nsupdate: fix 'index out of range' error when no TTL answer is given Fix a possible `list index out of range` when no answer is returned in the `ttl_changed` method by applying the existing workaround for NS records to all record types. Resolves #836 * fixup! nsupdate: fix 'index out of range' error when no TTL answer is given (cherry picked from commit 208df2c) Co-authored-by: Silke Hofstra <[email protected]>
…nsible-collections#7219) * nsupdate: fix 'index out of range' error when no TTL answer is given Fix a possible `list index out of range` when no answer is returned in the `ttl_changed` method by applying the existing workaround for NS records to all record types. Resolves ansible-collections#836 * fixup! nsupdate: fix 'index out of range' error when no TTL answer is given
SUMMARY
If you create an (MX) Entry via nsupdate and than run the same thing again, the playbook will fail the second time.
ISSUE TYPE
COMPONENT NAME
nsupdate
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
RHEL 7
Bind: 9.11.4-P2-RedHat-9.11.4-16.P2.el7_8.6
STEPS TO REPRODUCE
EXPECTED RESULTS
Playbook/Tasks results as "ok"
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: