community.general.jboss deployment python issues

, ,

Hello, I am having deployment issues with a wildfly / jboss application deployment.

The recent update to version 12.0 for the community.general module appears to have removed support python < 3.7. This is not an issue, however, one of my app deployments is now failing with the following error message from the jboss module – The module has references to python 3.6 which does not exist in my environment.

{
“started”: 1,
“finished”: 1,
“stdout”: “”,
“stderr”: “Traceback (most recent call last):\n File "/home/ansible/.ansible/tmp/ansible-tmp-1762291445.4748747-74-186058619142749/AnsiballZ_jboss.py", line 107, in \n _ansiballz_main()\n File "/home/ansible/.ansible/tmp/ansible-tmp-1762291445.4748747-74-186058619142749/AnsiballZ_jboss.py", line 99, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File "/home/ansible/.ansible/tmp/ansible-tmp-1762291445.4748747-74-186058619142749/AnsiballZ_jboss.py", line 48, in invoke_module\n run_name=‘main’, alter_sys=True)\n File "/usr/lib64/python3.6/runpy.py", line 201, in run_module\n mod_name, mod_spec, code = _get_module_details(mod_name)\n File "/usr/lib64/python3.6/runpy.py", line 128, in _get_module_details\n spec = importlib.util.find_spec(mod_name)\n File "/usr/lib64/python3.6/importlib/util.py", line 89, in find_spec\n return _find_spec(fullname, parent.path)\n File "", line 894, in _find_spec\n File "", line 1157, in find_spec\n File "", line 1131, in _get_spec\n File "", line 1112, in _legacy_get_spec\n File "", line 441, in spec_from_loader\n File "", line 544, in spec_from_file_location\n File "/tmp/ansible_community.general.jboss_payload_4br2wnm3/ansible_community.general.jboss_payload.zip/ansible_collections/community/general/plugins/modules/jboss.py", line 7\nSyntaxError: future feature annotations is not defined\n”,
“stdout_lines”: ,
“stderr_lines”: [
“Traceback (most recent call last):”,
" File "/home/ansible/.ansible/tmp/ansible-tmp-1762291445.4748747-74-186058619142749/AnsiballZ_jboss.py", line 107, in “,
" _ansiballz_main()”,
" File "/home/ansible/.ansible/tmp/ansible-tmp-1762291445.4748747-74-186058619142749/AnsiballZ_jboss.py", line 99, in _ansiballz_main",
" invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)“,
" File "/home/ansible/.ansible/tmp/ansible-tmp-1762291445.4748747-74-186058619142749/AnsiballZ_jboss.py", line 48, in invoke_module”,
" run_name=‘main’, alter_sys=True)“,
" File "/usr/lib64/python3.6/runpy.py", line 201, in run_module”,
" mod_name, mod_spec, code = _get_module_details(mod_name)“,
" File "/usr/lib64/python3.6/runpy.py", line 128, in _get_module_details”,
" spec = importlib.util.find_spec(mod_name)“,
" File "/usr/lib64/python3.6/importlib/util.py", line 89, in find_spec”,
" return _find_spec(fullname, parent.path)“,
" File "", line 894, in _find_spec”,
" File "", line 1157, in find_spec",
" File "", line 1131, in _get_spec",
" File "", line 1112, in _legacy_get_spec",
" File "", line 441, in spec_from_loader",
" File "", line 544, in spec_from_file_location",
" File "/tmp/ansible_community.general.jboss_payload_4br2wnm3/ansible_community.general.jboss_payload.zip/ansible_collections/community/general/plugins/modules/jboss.py", line 7",
“SyntaxError: future feature annotations is not defined”
],
“ansible_job_id”: “j646432530547.2358633”,
“results_file”: “/root/.ansible_async/j646432530547.2358633”,
“cmd”: “/home/ansible/.ansible/tmp/ansible-tmp-1762291445.4748747-74-186058619142749/AnsiballZ_jboss.py”,
“data”: “”,
“msg”: “Traceback (most recent call last):\n File "/tmp/ansible_ansible.legacy.async_wrapper_payload_pt4rb0rs/ansible_ansible.legacy.async_wrapper_payload.zip/ansible/modules/async_wrapper.py", line 180, in _run_module\n File "/tmp/ansible_ansible.legacy.async_wrapper_payload_pt4rb0rs/ansible_ansible.legacy.async_wrapper_payload.zip/ansible/modules/async_wrapper.py", line 98, in _filter_non_json_lines\nValueError: No start of json char found\n”,

This is my current environment below.
Ansible Automation Platform 2.5
RHEL 8.10 virtual machines
packaged custom execution environment with jboss community 11.4.1 module version

Using:

  • python >=3.11
  • ansible runner == 2.4.1
  • ansible core == 2.19.3
  • community.general == 11.4.1 && 12.0 (tried latest and previous release)

Has anyone experienced this error or have insight to point me in the correct direction?

Ansible has minimum versions of Python that are supported on the the target nodes as well the control node.

What appears to be happening here is that RHEL 8.10 ships with Python 3.6, and that’s what your playbook is attempting to run against on the remote server.

The support matrix for Ansible and Python versions is documented here:

Hi Mark,

I appreciate the assistance. I managed to detangle the stacktrace and updated the python on the remote nodes. I will add for anyone else who comes across this issue, RHEL 8.10 dnf has a dependancy on Python 3.6. You cannot remove that version from the node.

I worked around this issue by overriding the default ansible interpreter at the inventory level.

Nice fix! What method did you use to install a custom Python on the target?