]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
install python-xml on SUSE/openSUSE only if python2 is installed
authorJohannes Kastl <kastl@b1-systems.de>
Tue, 20 Aug 2019 11:32:32 +0000 (13:32 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Fri, 27 Sep 2019 15:50:10 +0000 (17:50 +0200)
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 <kastl@b1-systems.de>
(cherry picked from commit a1811ca097415990211248648dc3d9480f6841eb)

raw_install_python.yml

index 8d36c9dac7ef7762aafc6b491fc0440a911dd477..7b4b86ffdfd7eae5b14b76d24f7e0e5d840b93a2 100644 (file)
       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'