infobloxopen / infoblox-ansible

Ansible modules for interfacing to Infoblox systems
GNU General Public License v3.0
55 stars 62 forks source link

Issue creating txt record with an equals sign in the text field #126

Closed tgnelson closed 2 years ago

tgnelson commented 2 years ago

Discussed in https://github.com/infobloxopen/infoblox-ansible/discussions/125

Originally posted by **tgnelson** June 15, 2022 I am having trouble with the nios_txt_record task. In the same playbook I can create zones, a records, and C names without issue. This is an issue with having the = sign in the text field. Spaces or no spaces all work with the quotes. Fairly simple code for the TXT record which errors out. ``` tasks: - name: Create TXT Record on Internal Zone infoblox.nios_modules.nios_txt_record: name: somethingsomething.com text: "v=spf1 -all" view: Internal comment: this is a comment Created {{ ansible_date_time.date }} state: present provider: "{{ nios_provider }}" ``` ``` Traceback (most recent call last): File "/home/tom/.ansible/tmp/ansible-tmp-1655307979.564247-146494719259942/AnsiballZ_nios_txt_record.py", line 102, in _ansiballz_main() File "/home/tom/.ansible/tmp/ansible-tmp-1655307979.564247-146494719259942/AnsiballZ_nios_txt_record.py", line 94, in _ansiballz_main invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS) File "/home/tom/.ansible/tmp/ansible-tmp-1655307979.564247-146494719259942/AnsiballZ_nios_txt_record.py", line 40, in invoke_module runpy.run_module(mod_name='ansible_collections.infoblox.nios_modules.plugins.modules.nios_txt_record', init_globals=None, run_name='__main__', alter_sys=True) File "/usr/lib/python3.8/runpy.py", line 207, in run_module return _run_module_code(code, init_globals, run_name, mod_spec) File "/usr/lib/python3.8/runpy.py", line 97, in _run_module_code _run_code(code, mod_globals, init_globals, File "/usr/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/tmp/ansible_infoblox.nios_modules.nios_txt_record_payload_0f6casv9/ansible_infoblox.nios_modules.nios_txt_record_payload.zip/ansible_collections/infoblox/nios_modules/plugins/modules/nios_txt_record.py", line 139, in File "/tmp/ansible_infoblox.nios_modules.nios_txt_record_payload_0f6casv9/ansible_infoblox.nios_modules.nios_txt_record_payload.zip/ansible_collections/infoblox/nios_modules/plugins/modules/nios_txt_record.py", line 133, in main File "/tmp/ansible_infoblox.nios_modules.nios_txt_record_payload_0f6casv9/ansible_infoblox.nios_modules.nios_txt_record_payload.zip/ansible_collections/infoblox/nios_modules/plugins/module_utils/api.py", line 275, in run File "/tmp/ansible_infoblox.nios_modules.nios_txt_record_payload_0f6casv9/ansible_infoblox.nios_modules.nios_txt_record_payload.zip/ansible_collections/infoblox/nios_modules/plugins/module_utils/api.py", line 586, in get_object_ref File "/tmp/ansible_infoblox.nios_modules.nios_txt_record_payload_0f6casv9/ansible_infoblox.nios_modules.nios_txt_record_payload.zip/ansible/module_utils/common/validation.py", line 429, in check_type_dict ValueError: dictionary update sequence element #1 has length 1; 2 is required fatal: [localhost]: FAILED! => { "changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/home/tom/.ansible/tmp/ansible-tmp-1655307979.564247-146494719259942/AnsiballZ_nios_txt_record.py\", line 102, in \n _ansiballz_main()\n File \"/home/tom/.ansible/tmp/ansible-tmp-1655307979.564247-146494719259942/AnsiballZ_nios_txt_record.py\", line 94, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/tom/.ansible/tmp/ansible-tmp-1655307979.564247-146494719259942/AnsiballZ_nios_txt_record.py\", line 40, in invoke_module\n runpy.run_module(mod_name='ansible_collections.infoblox.nios_modules.plugins.modules.nios_txt_record', init_globals=None, run_name='__main__', alter_sys=True)\n File \"/usr/lib/python3.8/runpy.py\", line 207, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib/python3.8/runpy.py\", line 97, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File \"/usr/lib/python3.8/runpy.py\", line 87, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_infoblox.nios_modules.nios_txt_record_payload_0f6casv9/ansible_infoblox.nios_modules.nios_txt_record_payload.zip/ansible_collections/infoblox/nios_modules/plugins/modules/nios_txt_record.py\", line 139, in \n File \"/tmp/ansible_infoblox.nios_modules.nios_txt_record_payload_0f6casv9/ansible_infoblox.nios_modules.nios_txt_record_payload.zip/ansible_collections/infoblox/nios_modules/plugins/modules/nios_txt_record.py\", line 133, in main\n File \"/tmp/ansible_infoblox.nios_modules.nios_txt_record_payload_0f6casv9/ansible_infoblox.nios_modules.nios_txt_record_payload.zip/ansible_collections/infoblox/nios_modules/plugins/module_utils/api.py\", line 275, in run\n File \"/tmp/ansible_infoblox.nios_modules.nios_txt_record_payload_0f6casv9/ansible_infoblox.nios_modules.nios_txt_record_payload.zip/ansible_collections/infoblox/nios_modules/plugins/module_utils/api.py\", line 586, in get_object_ref\n File \"/tmp/ansible_infoblox.nios_modules.nios_txt_record_payload_0f6casv9/ansible_infoblox.nios_modules.nios_txt_record_payload.zip/ansible/module_utils/common/validation.py\", line 429, in check_type_dict\nValueError: dictionary update sequence element #1 has length 1; 2 is required\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1 }` ```