Open
Description
Summary
nsupdate fails to add or update NS records when it's already defined.
Issue Type
Bug Report
Component Name
nsupdate
Ansible Version
$ ansible --version
2.14.18
Community.general Version
$ ansible-galaxy collection list community.general
# /path/to/collection
Collection Version
------------------ ------
community.general 10.4.0
Configuration
OS / Environment
Debian 12
Steps to Reproduce
I'm managing a bind9 server with TSIG keys.
I have 4 records to register in 'my.domain' zone :
- record: sub, value: ns01.sub, type: NS
- record: sub, value: ns02.sub, type: NS
- record: ns01.sub, value: 1.2.3.4, type: A
- record: ns02.sub, value: 2.3.4.5, type: A
The first NS record acts normaly and is added in the DNS but the second NS record fails to be added and throw the below error.
I saw that this bug was already reported and fixed (issue 8612).
Expected Results
Not crashs and add or update ns records
Actual Results
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: IndexError: list index out of range
failed: [hostname] (item=sub.my.domain) => changed=false
ansible_loop_var: entry
entry:
record: sub
type: NS
value: ns02.sub
module_stderr: |-
Traceback (most recent call last):
File "<stdin>", line 107, in <module>
File "<stdin>", line 99, in _ansiballz_main
File "<stdin>", line 47, in invoke_module
File "<frozen runpy>", line 226, in run_module
File "<frozen runpy>", line 98, in _run_module_code
File "<frozen runpy>", line 88, in _run_code
File "/tmp/ansible_community.general.nsupdate_payload_lziqaob2/ansible_community.general.nsupdate_payload.zip/ansible_collections/community/general/plugins/modules/nsupdate.py", line 523, in <module>
File "/tmp/ansible_community.general.nsupdate_payload_lziqaob2/ansible_community.general.nsupdate_payload.zip/ansible_collections/community/general/plugins/modules/nsupdate.py", line 506, in main
File "/tmp/ansible_community.general.nsupdate_payload_lziqaob2/ansible_community.general.nsupdate_payload.zip/ansible_collections/community/general/plugins/modules/nsupdate.py", line 318, in create_or_update_record
File "/tmp/ansible_community.general.nsupdate_payload_lziqaob2/ansible_community.general.nsupdate_payload.zip/ansible_collections/community/general/plugins/modules/nsupdate.py", line 371, in modify_record
IndexError: list index out of range
module_stdout: ''
msg: |-
MODULE FAILURE
See stdout/stderr for the exact error
rc: 1
Code of Conduct
- I agree to follow the Ansible Code of Conduct