JoshBarrow
Cirrus
Feb 14, 2022Ansible Error: An exception occurred during task execution
Wondering if anyone has seen this type of error using Ansible.
Any information would be gladly appreciated!
Spoiler
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: split() takes no keyword arguments
fatal: [10.8.246.102]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, "module_stderr": "Trac eback (most recent call last):\n File \"/home/user/.ansible/tmp/ansible-tmp-1644857990.96-17262-103535251865389/AnsiballZ_bigip_virtual_server .py\", line 102, in <module>\n _ansiballz_main()\n File \"/home/user/.ansible/tmp/ansible-tmp-1644857990.96-17262-103535251865389/AnsiballZ _bigip_virtual_server.py\", line 94, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/user/.ansib le/tmp/ansible-tmp-1644857990.96-17262-103535251865389/AnsiballZ_bigip_virtual_server.py\", line 40, in invoke_module\n runpy.run_module(mod_na me='ansible_collections.f5networks.f5_modules.plugins.modules.bigip_virtual_server', init_globals=None, run_name='__main__', alter_sys=True)\n Fi le \"/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_f5networks.f5_modules.bigip_virtual_server_payload_HFw5OW/ansible_f5networks.f5_modules.bigip_virtual_server _payload.zip/ansible_collections/f5networks/f5_modules/plugins/modules/bigip_virtual_server.py\", line 3784, in <module>\n File \"/tmp/ansible_f5 networks.f5_modules.bigip_virtual_server_payload_HFw5OW/ansible_f5networks.f5_modules.bigip_virtual_server_payload.zip/ansible_collections/f5netwo rks/f5_modules/plugins/modules/bigip_virtual_server.py\", line 3777, in main\n File \"/tmp/ansible_f5networks.f5_modules.bigip_virtual_server_pay load_HFw5OW/ansible_f5networks.f5_modules.bigip_virtual_server_payload.zip/ansible_collections/f5networks/f5_modules/plugins/modules/bigip_virtual _server.py\", line 3427, in exec_module\n File \"/tmp/ansible_f5networks.f5_modules.bigip_virtual_server_payload_HFw5OW/ansible_f5networks.f5_mod ules.bigip_virtual_server_payload.zip/ansible_collections/f5networks/f5_modules/plugins/modules/bigip_virtual_server.py\", line 3440, in present\n File \"/tmp/ansible_f5networks.f5_modules.bigip_virtual_server_payload_HFw5OW/ansible_f5networks.f5_modules.bigip_virtual_server_payload.zip/ans ible_collections/f5networks/f5_modules/plugins/modules/bigip_virtual_server.py\", line 3463, in update\n File \"/tmp/ansible_f5networks.f5_module s.bigip_virtual_server_payload_HFw5OW/ansible_f5networks.f5_modules.bigip_virtual_server_payload.zip/ansible_collections/f5networks/f5_modules/plu gins/modules/bigip_virtual_server.py\", line 3471, in should_update\n File \"/tmp/ansible_f5networks.f5_modules.bigip_virtual_server_payload_HFw5 OW/ansible_f5networks.f5_modules.bigip_virtual_server_payload.zip/ansible_collections/f5networks/f5_modules/plugins/modules/bigip_virtual_server.p y\", line 3501, in _update_changed_options\n File \"/tmp/ansible_f5networks.f5_modules.bigip_virtual_server_payload_HFw5OW/ansible_f5networks.f5_ modules.bigip_virtual_server_payload.zip/ansible_collections/f5networks/f5_modules/plugins/modules/bigip_virtual_server.py\", line 3078, in compar e\n File \"/tmp/ansible_f5networks.f5_modules.bigip_virtual_server_payload_HFw5OW/ansible_f5networks.f5_modules.bigip_virtual_server_payload.zip/ ansible_collections/f5networks/f5_modules/plugins/modules/bigip_virtual_server.py\", line 3141, in destination\n File \"/tmp/ansible_f5networks.f 5_modules.bigip_virtual_server_payload_HFw5OW/ansible_f5networks.f5_modules.bigip_virtual_server_payload.zip/ansible_collections/f5networks/f5_mod ules/plugins/modules/bigip_virtual_server.py\", line 1920, in destination_tuple\n File \"/tmp/ansible_f5networks.f5_modules.bigip_virtual_server_ payload_HFw5OW/ansible_f5networks.f5_modules.bigip_virtual_server_payload.zip/ansible_collections/f5networks/f5_modules/plugins/module_utils/ipadd ress.py\", line 84, in compress_address\n # __lt__ and __eq__\nTypeError: split() takes no keyword arguments\n", "module_stdout": "", "msg": "M ODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
fatal: [10.8.246.102]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, "module_stderr": "Trac eback (most recent call last):\n File \"/home/user/.ansible/tmp/ansible-tmp-1644857990.96-17262-103535251865389/AnsiballZ_bigip_virtual_server .py\", line 102, in <module>\n _ansiballz_main()\n File \"/home/user/.ansible/tmp/ansible-tmp-1644857990.96-17262-103535251865389/AnsiballZ _bigip_virtual_server.py\", line 94, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/user/.ansib le/tmp/ansible-tmp-1644857990.96-17262-103535251865389/AnsiballZ_bigip_virtual_server.py\", line 40, in invoke_module\n runpy.run_module(mod_na me='ansible_collections.f5networks.f5_modules.plugins.modules.bigip_virtual_server', init_globals=None, run_name='__main__', alter_sys=True)\n Fi le \"/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_f5networks.f5_modules.bigip_virtual_server_payload_HFw5OW/ansible_f5networks.f5_modules.bigip_virtual_server _payload.zip/ansible_collections/f5networks/f5_modules/plugins/modules/bigip_virtual_server.py\", line 3784, in <module>\n File \"/tmp/ansible_f5 networks.f5_modules.bigip_virtual_server_payload_HFw5OW/ansible_f5networks.f5_modules.bigip_virtual_server_payload.zip/ansible_collections/f5netwo rks/f5_modules/plugins/modules/bigip_virtual_server.py\", line 3777, in main\n File \"/tmp/ansible_f5networks.f5_modules.bigip_virtual_server_pay load_HFw5OW/ansible_f5networks.f5_modules.bigip_virtual_server_payload.zip/ansible_collections/f5networks/f5_modules/plugins/modules/bigip_virtual _server.py\", line 3427, in exec_module\n File \"/tmp/ansible_f5networks.f5_modules.bigip_virtual_server_payload_HFw5OW/ansible_f5networks.f5_mod ules.bigip_virtual_server_payload.zip/ansible_collections/f5networks/f5_modules/plugins/modules/bigip_virtual_server.py\", line 3440, in present\n File \"/tmp/ansible_f5networks.f5_modules.bigip_virtual_server_payload_HFw5OW/ansible_f5networks.f5_modules.bigip_virtual_server_payload.zip/ans ible_collections/f5networks/f5_modules/plugins/modules/bigip_virtual_server.py\", line 3463, in update\n File \"/tmp/ansible_f5networks.f5_module s.bigip_virtual_server_payload_HFw5OW/ansible_f5networks.f5_modules.bigip_virtual_server_payload.zip/ansible_collections/f5networks/f5_modules/plu gins/modules/bigip_virtual_server.py\", line 3471, in should_update\n File \"/tmp/ansible_f5networks.f5_modules.bigip_virtual_server_payload_HFw5 OW/ansible_f5networks.f5_modules.bigip_virtual_server_payload.zip/ansible_collections/f5networks/f5_modules/plugins/modules/bigip_virtual_server.p y\", line 3501, in _update_changed_options\n File \"/tmp/ansible_f5networks.f5_modules.bigip_virtual_server_payload_HFw5OW/ansible_f5networks.f5_ modules.bigip_virtual_server_payload.zip/ansible_collections/f5networks/f5_modules/plugins/modules/bigip_virtual_server.py\", line 3078, in compar e\n File \"/tmp/ansible_f5networks.f5_modules.bigip_virtual_server_payload_HFw5OW/ansible_f5networks.f5_modules.bigip_virtual_server_payload.zip/ ansible_collections/f5networks/f5_modules/plugins/modules/bigip_virtual_server.py\", line 3141, in destination\n File \"/tmp/ansible_f5networks.f 5_modules.bigip_virtual_server_payload_HFw5OW/ansible_f5networks.f5_modules.bigip_virtual_server_payload.zip/ansible_collections/f5networks/f5_mod ules/plugins/modules/bigip_virtual_server.py\", line 1920, in destination_tuple\n File \"/tmp/ansible_f5networks.f5_modules.bigip_virtual_server_ payload_HFw5OW/ansible_f5networks.f5_modules.bigip_virtual_server_payload.zip/ansible_collections/f5networks/f5_modules/plugins/module_utils/ipadd ress.py\", line 84, in compress_address\n # __lt__ and __eq__\nTypeError: split() takes no keyword arguments\n", "module_stdout": "", "msg": "M ODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
Problem solved! At least for us. In short, the module in our playbook needs to be executed on the Big-IP itself which uses Python 2.7 and causes the "split()" error. In most cases this can be resolved with "connection: local" or "delegate_to: localhost", as it is with all the F5 Ansible modules. In our case the solution was a bit different, you can check the GitHub issue for explanation.