Replace injected Ansible fact variables in container-engine role (#13296)

This commit is contained in:
Nikhil Kumar
2026-06-16 08:51:24 +05:30
committed by GitHub
parent a76a475a5b
commit e0add9ee0d
21 changed files with 322 additions and 320 deletions

View File

@@ -46,7 +46,7 @@
dpkg_selections:
name: "{{ item }}"
selection: install
when: ansible_pkg_mgr == 'apt'
when: ansible_facts['pkg_mgr'] == 'apt'
changed_when: false
with_items:
- "{{ docker_packages_list }}"
@@ -61,7 +61,7 @@
- "{{ docker_packages_list }}"
- "{{ containerd_package }}"
when:
- not ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
- not ansible_facts['os_family'] in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
- not is_ostree
- docker_packages_list | length > 0
@@ -70,21 +70,21 @@
repo: "{{ item }}"
state: absent
with_items: "{{ docker_repo_info.repos }}"
when: ansible_pkg_mgr == 'apt'
when: ansible_facts['pkg_mgr'] == 'apt'
- name: Docker | Remove docker repository on Fedora
file:
name: "{{ yum_repo_dir }}/docker.repo"
state: absent
when: ansible_distribution == "Fedora" and not is_ostree
when: ansible_facts['distribution'] == "Fedora" and not is_ostree
- name: Docker | Remove docker repository on RedHat/CentOS/Oracle/AlmaLinux Linux
file:
name: "{{ yum_repo_dir }}/docker-ce.repo"
state: absent
when:
- ansible_os_family == "RedHat"
- ansible_distribution != "Fedora"
- ansible_facts['os_family'] == "RedHat"
- ansible_facts['distribution'] != "Fedora"
- not is_ostree
- name: Docker | Remove docker configuration files