From 714da1c5753b056db275c81ce545d8aae6c8446d Mon Sep 17 00:00:00 2001 From: Michele Pagot Date: Mon, 20 May 2024 17:27:21 +0200 Subject: [PATCH] Avoid python Azure package collision in SLES15 15SP4 and 15SP5 move some Azure related Python packages to Python 3.11 --- .../tasks/azure-cluster-bootstrap.yaml | 46 ++++++++++++++++--- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/ansible/playbooks/tasks/azure-cluster-bootstrap.yaml b/ansible/playbooks/tasks/azure-cluster-bootstrap.yaml index 849cb7b8..2c856ff2 100644 --- a/ansible/playbooks/tasks/azure-cluster-bootstrap.yaml +++ b/ansible/playbooks/tasks/azure-cluster-bootstrap.yaml @@ -44,16 +44,48 @@ - ansible_distribution_major_version == '15' - public_cloud_module != 'Registered' -# TODO: Version Control -- name: Ensure Azure Python SDK and Azure Identity python modules are installed +# For SLES 12 a we need to force a downgrade of python-azure-core see https://www.suse.com/support/kb/doc/?id=000020716 +- name: Ensure Azure Python SDK and Azure Identity python modules are installed [12sp5] community.general.zypper: - name: "{{ item.package }}" + name: "{{ item }}" state: present loop: - # For SLES 12 a we need to force a downgrade of python-azure-core see https://www.suse.com/support/kb/doc/?id=000020716 - - {'sles': '12', 'package': ['python-azure-mgmt-compute', 'python-azure-identity', 'python-azure-core==1.9.0-2.3.4']} - - {'sles': '15', 'package': ['python3-azure-mgmt-compute', 'python3-azure-identity']} - when: item.sles == ansible_distribution_major_version + - 'python-azure-mgmt-compute' + - 'python-azure-identity' + - 'python-azure-core==1.9.0-2.3.4' + when: + - ansible_distribution_major_version == 12 + register: result + until: result is succeeded + retries: 3 + delay: 60 + +- name: Ensure Azure Python SDK and Azure Identity python modules are installed [15 sp<4] + community.general.zypper: + name: "{{ item }}" + state: present + loop: + - 'python3-azure-mgmt-compute' + - 'python3-azure-identity' + when: + - ansible_distribution_major_version == 15 + - ansible_distribution_release < 4 + register: result + until: result is succeeded + retries: 3 + delay: 60 + +# https://www.suse.com/c/incompatible-changes-ahead-for-public-cloud-sdks/ +- name: Ensure Azure Python SDK and Azure Identity python modules are installed [15 sp>=4] + community.general.zypper: + name: "{{ item }}" + state: present + loop: + - 'python311-azure-mgmt-compute' + - 'python311-azure-identity' + when: + - ansible_distribution_major_version == 15 + - ansible_distribution_release >= 4 register: result until: result is succeeded retries: 3