Skip to content

Commit

Permalink
Avoid python Azure package collision in SLES15 (#232)
Browse files Browse the repository at this point in the history
15SP4 and 15SP5 move some Azure related Python packages to Python 3.11
  • Loading branch information
mpagot authored May 21, 2024
1 parent 6ddeade commit d797322
Showing 1 changed file with 38 additions and 7 deletions.
45 changes: 38 additions & 7 deletions ansible/playbooks/tasks/azure-cluster-bootstrap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,47 @@
- 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_version is version('12.5', '==')
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_version is version('15.4', '<')
- ansible_distribution_version is version('12.5', '!=')
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_version is version('15.4', '>=')
register: result
until: result is succeeded
retries: 3
Expand Down

0 comments on commit d797322

Please sign in to comment.