mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-10-29 22:03:22 -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>
54 lines
1.5 KiB
YAML
54 lines
1.5 KiB
YAML
---
|
|
# Some Debian based distros ship without Python installed
|
|
|
|
- name: Check if bootstrap is needed
|
|
raw: which python3
|
|
register: need_bootstrap
|
|
failed_when: false
|
|
changed_when: false
|
|
# This command should always run, even in check mode
|
|
check_mode: false
|
|
tags:
|
|
- facts
|
|
|
|
- name: Check http::proxy in apt configuration files
|
|
raw: apt-config dump | grep -qsi 'Acquire::http::proxy'
|
|
register: need_http_proxy
|
|
failed_when: false
|
|
changed_when: false
|
|
# This command should always run, even in check mode
|
|
check_mode: false
|
|
|
|
- name: Add http_proxy to /etc/apt/apt.conf if http_proxy is defined
|
|
raw: echo 'Acquire::http::proxy "{{ http_proxy }}";' >> /etc/apt/apt.conf
|
|
become: true
|
|
when:
|
|
- http_proxy is defined
|
|
- need_http_proxy.rc != 0
|
|
- not skip_http_proxy_on_os_packages
|
|
|
|
- name: Check https::proxy in apt configuration files
|
|
raw: apt-config dump | grep -qsi 'Acquire::https::proxy'
|
|
register: need_https_proxy
|
|
failed_when: false
|
|
changed_when: false
|
|
# This command should always run, even in check mode
|
|
check_mode: false
|
|
|
|
- name: Add https_proxy to /etc/apt/apt.conf if https_proxy is defined
|
|
raw: echo 'Acquire::https::proxy "{{ https_proxy }}";' >> /etc/apt/apt.conf
|
|
become: true
|
|
when:
|
|
- https_proxy is defined
|
|
- need_https_proxy.rc != 0
|
|
- not skip_http_proxy_on_os_packages
|
|
|
|
- name: Install python3
|
|
raw:
|
|
apt-get update && \
|
|
DEBIAN_FRONTEND=noninteractive apt-get install -y python3-minimal
|
|
become: true
|
|
when:
|
|
- bootstrap_os_install_python
|
|
- need_bootstrap.rc != 0
|