|
@ -16,6 +16,9 @@ |
|
|
path: "/etc/systemd/system/kubelet.service" |
|
|
path: "/etc/systemd/system/kubelet.service" |
|
|
register: kubelet_systemd_unit_exists |
|
|
register: kubelet_systemd_unit_exists |
|
|
|
|
|
|
|
|
|
|
|
- name: Populate service facts |
|
|
|
|
|
service_facts: |
|
|
|
|
|
|
|
|
- name: Check if containerd is installed |
|
|
- name: Check if containerd is installed |
|
|
find: |
|
|
find: |
|
|
file_type: file |
|
|
file_type: file |
|
@ -72,16 +75,17 @@ |
|
|
when: |
|
|
when: |
|
|
- kubelet_systemd_unit_exists |
|
|
- kubelet_systemd_unit_exists |
|
|
- name: Remove Containerd |
|
|
- name: Remove Containerd |
|
|
include_role: |
|
|
|
|
|
|
|
|
import_role: |
|
|
name: container-engine/containerd |
|
|
name: container-engine/containerd |
|
|
apply: |
|
|
|
|
|
tags: |
|
|
|
|
|
- reset_containerd |
|
|
|
|
|
|
|
|
tasks_from: reset |
|
|
|
|
|
vars: |
|
|
|
|
|
service_name: containerd.service |
|
|
when: |
|
|
when: |
|
|
- not (is_ostree or (ansible_distribution == "Flatcar Container Linux by Kinvolk") or (ansible_distribution == "Flatcar")) |
|
|
- not (is_ostree or (ansible_distribution == "Flatcar Container Linux by Kinvolk") or (ansible_distribution == "Flatcar")) |
|
|
- container_manager != "containerd" |
|
|
- container_manager != "containerd" |
|
|
- docker_installed.matched == 0 |
|
|
- docker_installed.matched == 0 |
|
|
- containerd_installed.matched > 0 |
|
|
- containerd_installed.matched > 0 |
|
|
|
|
|
- ansible_facts.services[service_name]['state'] == 'running' |
|
|
|
|
|
|
|
|
- name: Uninstall docker |
|
|
- name: Uninstall docker |
|
|
block: |
|
|
block: |
|
@ -100,15 +104,16 @@ |
|
|
when: |
|
|
when: |
|
|
- kubelet_systemd_unit_exists |
|
|
- kubelet_systemd_unit_exists |
|
|
- name: Remove Docker |
|
|
- name: Remove Docker |
|
|
include_role: |
|
|
|
|
|
|
|
|
import_role: |
|
|
name: container-engine/docker |
|
|
name: container-engine/docker |
|
|
apply: |
|
|
|
|
|
tags: |
|
|
|
|
|
- reset_docker |
|
|
|
|
|
|
|
|
tasks_from: reset |
|
|
|
|
|
vars: |
|
|
|
|
|
service_name: docker.service |
|
|
when: |
|
|
when: |
|
|
- not (is_ostree or (ansible_distribution == "Flatcar Container Linux by Kinvolk") or (ansible_distribution == "Flatcar")) |
|
|
- not (is_ostree or (ansible_distribution == "Flatcar Container Linux by Kinvolk") or (ansible_distribution == "Flatcar")) |
|
|
- container_manager != "docker" |
|
|
- container_manager != "docker" |
|
|
- docker_installed.matched > 0 |
|
|
- docker_installed.matched > 0 |
|
|
|
|
|
- ansible_facts.services[service_name]['state'] == 'running' |
|
|
|
|
|
|
|
|
- name: Uninstall crio |
|
|
- name: Uninstall crio |
|
|
block: |
|
|
block: |
|
@ -127,12 +132,13 @@ |
|
|
when: |
|
|
when: |
|
|
- kubelet_systemd_unit_exists |
|
|
- kubelet_systemd_unit_exists |
|
|
- name: Remove CRI-O |
|
|
- name: Remove CRI-O |
|
|
include_role: |
|
|
|
|
|
name: container-engine/crio |
|
|
|
|
|
apply: |
|
|
|
|
|
tags: |
|
|
|
|
|
- reset_crio |
|
|
|
|
|
|
|
|
import_role: |
|
|
|
|
|
name: container-engine/cri-o |
|
|
|
|
|
tasks_from: reset |
|
|
|
|
|
vars: |
|
|
|
|
|
service_name: crio.service |
|
|
when: |
|
|
when: |
|
|
- not (is_ostree or (ansible_distribution == "Flatcar Container Linux by Kinvolk") or (ansible_distribution == "Flatcar")) |
|
|
- not (is_ostree or (ansible_distribution == "Flatcar Container Linux by Kinvolk") or (ansible_distribution == "Flatcar")) |
|
|
- container_manager != "crio" |
|
|
- container_manager != "crio" |
|
|
- crio_installed.matched > 0 |
|
|
- crio_installed.matched > 0 |
|
|
|
|
|
- ansible_facts.services[service_name]['state'] == 'running' |