From 2463c8eca1e970a0f6fe0f3f9a2a7db44e59e064 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 (cherry picked from commit a1811ca097415990211248648dc3d9480f6841eb) --- raw_install_python.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/raw_install_python.yml b/raw_install_python.yml index 8d36c9dac..7b4b86ffd 100644 --- a/raw_install_python.yml +++ b/raw_install_python.yml @@ -55,4 +55,15 @@ register: result until: result is succeeded when: stat_zypper.rc == 0 - when: not True in (systempython.results | selectattr('stat', 'defined') | map(attribute='stat.exists') | list | unique) \ No newline at end of file + 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'