[ensure-python] Fix for CentOS/RHEL 9 packages
This commit introduces a conditional for RPM package name when running on a recent CentOS/RHEL system. Change-Id: I716cc97a8dace02c874d2e39dc90d6a42808ebf6
This commit is contained in:
parent
e3b7e0dcf6
commit
272f091cf9
@ -23,10 +23,21 @@
|
||||
- name: Install specified version of python interpreter and development files (RPM)
|
||||
when:
|
||||
- ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat'
|
||||
package:
|
||||
name: python{{ python_version | replace('.', '') }}-devel
|
||||
state: present
|
||||
become: yes
|
||||
block:
|
||||
- name: Set default RPM package name
|
||||
set_fact:
|
||||
rpm_python_pkg_name: python{{ python_version | replace('.', '') }}-devel
|
||||
- name: Set RPM package name for CentOS/RHEL 9 and Python 3.9
|
||||
set_fact:
|
||||
rpm_python_pkg_name: python3-devel
|
||||
when:
|
||||
- ansible_distribution_major_version == '9'
|
||||
- python_version == '3.9'
|
||||
- name: Install RPM package
|
||||
package:
|
||||
name: "{{ rpm_python_pkg_name }}"
|
||||
state: present
|
||||
become: yes
|
||||
|
||||
- name: Install python using pyenv
|
||||
when:
|
||||
|
Loading…
Reference in New Issue
Block a user