Playbook is simple cleanup of unneeded packages. Task like (without loop)
- name: remove unneeded package
zypper:
name: cups
state: absent
After update to 2.9 this error is thrown:
failed: [internum.augsburg.edu] (item=xhost) => {“ansible_loop_var”: “item”, “changed”: false, “item”: “xhost”, “module_stderr”: "Traceback (most recent call last):\n File "", line 102, in \n File "", line 94, in _ansiballz_main\n File "
“, line 40, in invoke_module\n File "/usr/lib64/python2.7/runpy.py", line 192, in run_module\n fname, 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_zypper_payload_2pSpWr/ansible_zypper_payload.zip/ansible/modules/packaging/
os/zypper.py", line 195, in \nImportError: No module named xml\n”, “module_stdout”: “”, “msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”, “rc”: 1}
2019-11-05 14:50:47,427 p=fortier u=11890 | ok: [herodotus.augsburg.edu] => (item=cups-libs-32bit)
There’s a fair amount of noise in this error message (loop and hosts) but as I’m reading it, the key issue is
ImportError: No module named xml
I then tried loading python-xml (the dependency is mentioned in the current docs) with this:
- name: load required ansible python module
zypper:
- name: python-xml
- state: present
And received the same error.
I sort of get what’s going on here, current version of zypper have rich xml support, which is easier/cleaner/more-accurate than parsing CLI output, but it seems to me a regression to not allow the older style (with a warning).