mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-10-30 22:16:23 -02:30
* Enable AlmaLinux 8 and Rocky Linux 8 Calico CI Install Python 3.12 with yum before gathering facts when the interpreter selected by Ansible is missing or older than Python 3.9, and add bootstrap_os_install_python to control distribution-specific Python bootstrap installation. EL8 only ships the libselinux Python bindings for the distribution Python 3.6, so ansible.posix.selinux fails once Kubespray runs with Python 3.12. Keep using the module when the bindings are importable and otherwise set the policy in /etc/selinux/config and apply the runtime state with setenforce. Enable rockylinux8-calico in regular PR CI, add almalinux8-calico as a manual job, and document the RHEL 8 family lifecycle. Signed-off-by: Kay Yan <kay.yan@daocloud.io> * Fix EL8 containerd compatibility and SELinux runtime transitions Signed-off-by: Kay Yan <kay.yan@daocloud.io> --------- Signed-off-by: Kay Yan <kay.yan@daocloud.io>
32 lines
956 B
YAML
32 lines
956 B
YAML
---
|
|
# Some Fedora based distros ship without Python installed
|
|
|
|
- name: Check if bootstrap is needed
|
|
raw: which python
|
|
register: need_bootstrap
|
|
failed_when: false
|
|
changed_when: false
|
|
tags:
|
|
- facts
|
|
|
|
- name: Add proxy to dnf.conf if http_proxy is defined
|
|
community.general.ini_file:
|
|
path: "/etc/dnf/dnf.conf"
|
|
section: main
|
|
option: proxy
|
|
value: "{{ http_proxy | default(omit) }}"
|
|
state: "{{ http_proxy | default(False) | ternary('present', 'absent') }}"
|
|
no_extra_spaces: true
|
|
mode: "0644"
|
|
become: true
|
|
when: not skip_http_proxy_on_os_packages
|
|
|
|
# libselinux-python3 is required on SELinux enabled hosts
|
|
# See https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#managed-node-requirements
|
|
- name: Install ansible requirements
|
|
raw: "dnf install --assumeyes python3 python3-dnf libselinux-python3"
|
|
become: true
|
|
when:
|
|
- bootstrap_os_install_python
|
|
- need_bootstrap.rc != 0
|