diff --git a/roles/bootstrap-os/tasks/bootstrap-centos.yml b/roles/bootstrap-os/tasks/bootstrap-centos.yml index 057231a0726..1b5224f347e 100644 --- a/roles/bootstrap-os/tasks/bootstrap-centos.yml +++ b/roles/bootstrap-os/tasks/bootstrap-centos.yml @@ -37,11 +37,16 @@ when: - http_proxy is defined +- name: Gather host facts to get ansible_distribution_major_version + setup: + gather_subset: '!all' + filter: ansible_distribution_major_version + # libselinux-python is required on SELinux enabled hosts # See https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#managed-node-requirements - name: Install libselinux python package package: - name: "{{ ( (ansible_facts.distribution_major_version | default(0) | int) < 8) | ternary('libselinux-python','python3-libselinux') }}" + name: "{{ ( (ansible_distribution_major_version | int) < 8) | ternary('libselinux-python','python3-libselinux') }}" state: present become: true when: diff --git a/roles/container-engine/containerd/templates/rh_containerd.repo.j2 b/roles/container-engine/containerd/templates/rh_containerd.repo.j2 index 98936a66af5..6c63239a34b 100644 --- a/roles/container-engine/containerd/templates/rh_containerd.repo.j2 +++ b/roles/container-engine/containerd/templates/rh_containerd.repo.j2 @@ -6,6 +6,7 @@ gpgcheck=1 keepcache={{ docker_rpm_keepcache | default('1') }} gpgkey={{ docker_rh_repo_gpgkey }} {% if http_proxy is defined %}proxy={{ http_proxy }}{% endif %} +{% if ansible_os_family == "RedHat" and ansible_distribution_major_version|int == 8 %}module_hotfixes=True{% endif %} [docker-engine] name=Docker-Engine Repository @@ -15,3 +16,4 @@ gpgcheck=1 keepcache={{ docker_rpm_keepcache | default('1') }} gpgkey={{ dockerproject_rh_repo_gpgkey }} {% if http_proxy is defined %}proxy={{ http_proxy }}{% endif %} +{% if ansible_os_family == "RedHat" and ansible_distribution_major_version|int == 8 %}module_hotfixes=True{% endif %} diff --git a/roles/container-engine/docker/templates/rh_docker.repo.j2 b/roles/container-engine/docker/templates/rh_docker.repo.j2 index 98936a66af5..6c63239a34b 100644 --- a/roles/container-engine/docker/templates/rh_docker.repo.j2 +++ b/roles/container-engine/docker/templates/rh_docker.repo.j2 @@ -6,6 +6,7 @@ gpgcheck=1 keepcache={{ docker_rpm_keepcache | default('1') }} gpgkey={{ docker_rh_repo_gpgkey }} {% if http_proxy is defined %}proxy={{ http_proxy }}{% endif %} +{% if ansible_os_family == "RedHat" and ansible_distribution_major_version|int == 8 %}module_hotfixes=True{% endif %} [docker-engine] name=Docker-Engine Repository @@ -15,3 +16,4 @@ gpgcheck=1 keepcache={{ docker_rpm_keepcache | default('1') }} gpgkey={{ dockerproject_rh_repo_gpgkey }} {% if http_proxy is defined %}proxy={{ http_proxy }}{% endif %} +{% if ansible_os_family == "RedHat" and ansible_distribution_major_version|int == 8 %}module_hotfixes=True{% endif %} diff --git a/roles/kubernetes/preinstall/vars/centos.yml b/roles/kubernetes/preinstall/vars/centos.yml index 68406d61d5b..2b35e2e16f3 100644 --- a/roles/kubernetes/preinstall/vars/centos.yml +++ b/roles/kubernetes/preinstall/vars/centos.yml @@ -1,6 +1,6 @@ --- required_pkgs: - - "{{ ( (ansible_facts.distribution_major_version | default(0) | int) < 8) | ternary('libselinux-python','python3-libselinux') }}" + - "{{ ( (ansible_distribution_major_version | int) < 8) | ternary('libselinux-python','python3-libselinux') }}" - device-mapper-libs - ebtables - nss diff --git a/roles/kubernetes/preinstall/vars/redhat.yml b/roles/kubernetes/preinstall/vars/redhat.yml index 68406d61d5b..2b35e2e16f3 100644 --- a/roles/kubernetes/preinstall/vars/redhat.yml +++ b/roles/kubernetes/preinstall/vars/redhat.yml @@ -1,6 +1,6 @@ --- required_pkgs: - - "{{ ( (ansible_facts.distribution_major_version | default(0) | int) < 8) | ternary('libselinux-python','python3-libselinux') }}" + - "{{ ( (ansible_distribution_major_version | int) < 8) | ternary('libselinux-python','python3-libselinux') }}" - device-mapper-libs - ebtables - nss diff --git a/roles/reset/tasks/main.yml b/roles/reset/tasks/main.yml index b11d6137aac..8c516a59737 100644 --- a/roles/reset/tasks/main.yml +++ b/roles/reset/tasks/main.yml @@ -290,7 +290,11 @@ service: name: >- {% if ansible_os_family == "RedHat" -%} + {%- if ansible_distribution_major_version|int == 8 -%} + NetworkManager + {%- else -%} network + {%- endif -%} {%- elif ansible_distribution == "Ubuntu" and ansible_distribution_release == "bionic" -%} systemd-networkd {%- elif ansible_os_family == "Debian" -%}