mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-06-26 00:48:04 -02:30
Replace injected Ansible fact variables in container-engine role (#13296)
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
|
||||
- name: Cri-o | special handling for amazon linux
|
||||
import_tasks: "setup-amazon.yaml"
|
||||
when: ansible_distribution in ["Amazon"]
|
||||
when: ansible_facts['distribution'] in ["Amazon"]
|
||||
|
||||
- name: Cri-o | build a list of crio runtimes with Katacontainers runtimes
|
||||
set_fact:
|
||||
@@ -189,7 +189,7 @@
|
||||
dest: /etc/containers/mounts.conf
|
||||
mode: "0644"
|
||||
when:
|
||||
- ansible_os_family == 'RedHat'
|
||||
- ansible_facts['os_family'] == 'RedHat'
|
||||
notify: Restart crio
|
||||
|
||||
- name: Cri-o | create directory for oci hooks
|
||||
@@ -220,7 +220,9 @@
|
||||
dest: /etc/containers/storage.conf
|
||||
section: storage.options.overlay
|
||||
option: mountopt
|
||||
value: '{{ ''"nodev"'' if ansible_kernel is version(("4.18" if ansible_os_family == "RedHat" else "4.19"), "<") else ''"nodev,metacopy=on"'' }}'
|
||||
value: >-
|
||||
{{ '"nodev"' if ansible_facts['kernel'] is version(('4.18' if ansible_facts['os_family'] == 'RedHat' else '4.19'), '<')
|
||||
else '"nodev,metacopy=on"' }}
|
||||
mode: "0644"
|
||||
|
||||
- name: Cri-o | create directory registries configs
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
- name: CRI-O | Kubic repo name for debian os family
|
||||
set_fact:
|
||||
crio_kubic_debian_repo_name: "{{ ((ansible_distribution == 'Ubuntu') | ternary('x', '')) ~ ansible_distribution ~ '_' ~ ansible_distribution_version }}"
|
||||
when: ansible_os_family == "Debian"
|
||||
crio_kubic_debian_repo_name: "{{ ((ansible_facts['distribution'] == 'Ubuntu') | ternary('x', '')) ~ ansible_facts['distribution'] ~ '_' ~ ansible_facts['distribution_version'] }}"
|
||||
when: ansible_facts['os_family'] == "Debian"
|
||||
tags:
|
||||
- reset_crio
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
yum_repository:
|
||||
name: devel_kubic_libcontainers_stable
|
||||
state: absent
|
||||
when: ansible_distribution in ["Amazon"]
|
||||
when: ansible_facts['distribution'] in ["Amazon"]
|
||||
tags:
|
||||
- reset_crio
|
||||
|
||||
@@ -39,15 +39,15 @@
|
||||
name: "devel_kubic_libcontainers_stable_cri-o_v{{ crio_version }}"
|
||||
state: absent
|
||||
when:
|
||||
- ansible_os_family == "RedHat"
|
||||
- ansible_distribution not in ["Amazon", "Fedora"]
|
||||
- ansible_facts['os_family'] == "RedHat"
|
||||
- ansible_facts['distribution'] not in ["Amazon", "Fedora"]
|
||||
tags:
|
||||
- reset_crio
|
||||
|
||||
- name: CRI-O | Run yum-clean-metadata
|
||||
command: yum clean metadata
|
||||
when:
|
||||
- ansible_os_family == "RedHat"
|
||||
- ansible_facts['os_family'] == "RedHat"
|
||||
tags:
|
||||
- reset_crio
|
||||
|
||||
|
||||
Reference in New Issue
Block a user