From a1811ca097415990211248648dc3d9480f6841eb Mon Sep 17 00:00:00 2001 From: Johannes Kastl Date: Tue, 20 Aug 2019 13:32:32 +0200 Subject: [PATCH] install python-xml on SUSE/openSUSE only if python2 is installed raw_install_python.yml: on SUSE/openSUSE, install python-xml package only if python2 is installed already Background: On SLES 15.x / openSUSE Leap 15.x, the python2 package `python-base` provides /usr/bin/python, while python3 only provides /usr/bin/python3. Signed-off-by: Johannes Kastl --- raw_install_python.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/raw_install_python.yml b/raw_install_python.yml index 99003a1b3..97be5a31b 100644 --- a/raw_install_python.yml +++ b/raw_install_python.yml @@ -56,3 +56,14 @@ until: result is succeeded when: stat_zypper.rc == 0 when: not True in (systempython.results | selectattr('stat', 'defined') | map(attribute='stat.exists') | list | unique) + +- name: install python-xml for opensuse only if python2 is installed already + raw: zypper -n install python-xml + register: result + until: result is succeeded + with_items: "{{ systempython.results }}" + when: + - stat_zypper.rc is defined + - stat_zypper.rc == 0 + - item.stat.exists | bool + - item.stat.path == '/usr/bin/python'