nsupdate returning with syntax error

Posted on

I am using Ansible 27.17 with dnspython 1.16.0 and am getting a syntax error when using nsupdate. All the parameters have values but I don't know what is causing the syntax issue.

tasks:
- name: Update DNS
nsupdate:
key_name: "nsupdate"
key_algorithm: "hmac-sha256"
key_secret: "XoSxejcav8NIb20tpbWEOqnfUvV9ZnMk21GPxVtJZQE="
server: "{{ dns_server }}"
zone: "habana-labs.com"
record: "{{ rhvm_vm_name_dot }}"
value: "{{ vm_ip }}"
state: present

The full traceback is:
Traceback (most recent call last):
File "/root/.ansible/tmp/ansible-tmp-1593614309.17-18692-62230808247825/AnsiballZ_nsupdate.py", line 102, in
_ansiballz_main()
File "/root/.ansible/tmp/ansible-tmp-1593614309.17-18692-62230808247825/AnsiballZ_nsupdate.py", line 94, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/root/.ansible/tmp/ansible-tmp-1593614309.17-18692-62230808247825/AnsiballZ_nsupdate.py", line 40, in invoke_module
runpy.run_module(mod_name='ansible.modules.net_tools.nsupdate', init_globals=None, run_name='main', alter_sys=True)
File "/usr/lib64/python2.7/runpy.py", line 176, in run_module
fname, loader, pkg_name)
File "/usr/lib64/python2.7/runpy.py", line 82, in _run_module_code
mod_name, mod_fname, mod_loader, pkg_name)
File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/tmp/ansible_nsupdate_payload_tyLJUd/ansible_nsupdate_payload.zip/ansible/modules/net_tools/nsupdate.py", line 184, in
File "build/bdist.linux-x86_64/egg/dns/update.py", line 21, in
File "/usr/lib/python2.7/site-packages/dnspython-2.0.0dev2-py2.7.egg/dns/message.py", line 187
s.write(f';{name}\n')
^
SyntaxError: invalid syntax
fatal: [localhost]: FAILED! => {
"changed": false,
"module_stderr": "Traceback (most recent call last):\n File \"/root/.ansible/tmp/ansible-tmp-1593614309.17-18692-62230808247825/AnsiballZ_nsupdate.py\", line 102, in \n _ansiballz_main()\n File \"/root/.ansible/tmp/ansible-tmp-1593614309.17-18692-62230808247825/AnsiballZ_nsupdate.py\", line 94, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/root/.ansible/tmp/ansible-tmp-1593614309.17-18692-62230808247825/AnsiballZ_nsupdate.py\", line 40, in invoke_module\n runpy.run_module(mod_name='ansible.modules.net_tools.nsupdate', init_globals=None, run_name='main', alter_sys=True)\n File \"/usr/lib64/python2.7/runpy.py\", line 176, in run_module\n fname, loader, pkg_name)\n File \"/usr/lib64/python2.7/runpy.py\", line 82, in _run_module_code\n mod_name, mod_fname, mod_loader, pkg_name)\n File \"/usr/lib64/python2.7/runpy.py\", line 72, in _run_code\n exec code in run_globals\n File \"/tmp/ansible_nsupdate_payload_tyLJUd/ansible_nsupdate_payload.zip/ansible/modules/net_tools/nsupdate.py\", line 184, in \n File \"build/bdist.linux-x86_64/egg/dns/update.py\", line 21, in \n File \"/usr/lib/python2.7/site-packages/dnspython-2.0.0dev2-py2.7.egg/dns/message.py\", line 187\n s.write(f';{name}\n')\n ^\nSyntaxError: invalid syntax\n",
"module_stdout": "",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1
}

Responses