Merge "[ensure-python] Fix for CentOS/RHEL 9 packages"

This commit is contained in:
Zuul
2022-03-01 16:05:50 +00:00
committed by Gerrit Code Review

View File

@@ -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: