After fixing the argument issue, I’m stuck with this:
I have a role lr_nsupdate so:
- - -
- name: Show calling args
debug:
var: ca
- name: Update DNS master server
community.general.nsupdate:
key_name: '{{ key_name }}'
key_algorithm: '{{ algorithm }}'
key_secret: '{{ secret }}'
server: '{{ server }}'
zone: '{{ ca.zone | default(None) }}'
record: '{{ ca.owner_name }}'
ttl: '{{ the_ttl | default(3600) }}'
type: '{{ ca.type }}'
value: '{{ ca.RDATA | default(None) }}'
state: "{{ ca.state | default('present') }}"
delegate_to: localhost
- - -
When I call it so in another role:
- - -
- name: 'Delete CNAME db.lrau.net'
include_role:
name: lr_nsupdate
vars:
ca:
owner_name: 'db.lrau.net.'
state: 'absent'
type: ‚CNAME‘
- - -
I get:
- - -
TASK [lr_nsupdate : Show calling args] *********************************************************************************************************************************************************************************************************************
ok: [dbo5] => {
"ca": {
"owner_name": "db.lrau.net.",
"state": "absent",
"type": "CNAME"
}
}
TASK [lr_nsupdate : Update DNS master server] **************************************************************************************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: IndexError: string index out of range
fatal: [dbo5 -> localhost]: FAILED! => {"changed": false, "module_stderr": "Shared connection to localhost closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n File \"/root/.ansible/tmp/ansible-tmp-1639333586.086785-18489-58263131450333/AnsiballZ_nsupdate.py\", line 100, in <module>\r\n _ansiballz_main()\r\n File \"/root/.ansible/tmp/ansible-tmp-1639333586.086785-18489-58263131450333/AnsiballZ_nsupdate.py\", line 92, in _ansiballz_main\r\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n File \"/root/.ansible/tmp/ansible-tmp-1639333586.086785-18489-58263131450333/AnsiballZ_nsupdate.py\", line 41, in invoke_module\r\n run_name='__main__', alter_sys=True)\r\n File \"/usr/local/lib/python3.7/runpy.py\", line 205, in run_module\r\n return _run_module_code(code, init_globals, run_name, mod_spec)\r\n File \"/usr/local/lib/python3.7/runpy.py\", line 96, in _run_module_code\r\n mod_name, mod_spec, pkg_name, script_name)\r\n File \"/usr/local/lib/python3.7/runpy.py\", line 85, in _run_code\r\n exec(code, run_globals)\r\n File \"/tmp/ansible_community.general.nsupdate_payload_3364ymle/ansible_community.general.nsupdate_payload.zip/ansible_collections/community/general/plugins/modules/nsupdate.py\", line 483, in <module>\r\n File \"/tmp/ansible_community.general.nsupdate_payload_3364ymle/ansible_community.general.nsupdate_payload.zip/ansible_collections/community/general/plugins/modules/nsupdate.py\", line 461, in main\r\n File \"/tmp/ansible_community.general.nsupdate_payload_3364ymle/ansible_community.general.nsupdate_payload.zip/ansible_collections/community/general/plugins/modules/nsupdate.py\", line 233, in __init__\r\nIndexError: string index out of range\r\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
Is this a bug in the nsupdate module?
Thanks, Axel