From f6953f8c85490aa55421f0bcc671badd7d9f6b6a Mon Sep 17 00:00:00 2001 From: Evgeniy Artemenko Date: Fri, 9 Dec 2022 14:58:20 +0200 Subject: [PATCH] Skip retry operation with containerd when etcd installed on host VM --- reset.yml | 3 +++ roles/reset/tasks/main.yml | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/reset.yml b/reset.yml index 20015700a..6fa9fa3ac 100644 --- a/reset.yml +++ b/reset.yml @@ -29,6 +29,9 @@ msg: "Reset confirmation failed" when: reset_confirmation != "yes" + - name: Gather information about installed services + service_facts: + environment: "{{ proxy_disable_env }}" roles: - { role: kubespray-defaults} diff --git a/roles/reset/tasks/main.yml b/roles/reset/tasks/main.yml index 60f9d015d..e8f0103a5 100644 --- a/roles/reset/tasks/main.yml +++ b/roles/reset/tasks/main.yml @@ -65,6 +65,7 @@ when: - crictl.stat.exists - container_manager in ["crio", "containerd"] + - ansible_facts.services['containerd.service'] is defined ignore_errors: true # noqa ignore-errors - name: reset | force remove all cri containers @@ -80,6 +81,7 @@ - crictl.stat.exists - container_manager in ["crio", "containerd"] - deploy_container_engine + - ansible_facts.services['containerd.service'] is defined ignore_errors: true # noqa ignore-errors - name: reset | stop and disable crio service @@ -109,6 +111,7 @@ when: - crictl.stat.exists - container_manager == "containerd" + - ansible_facts.services['containerd.service'] is defined ignore_errors: true # noqa ignore-errors - block: @@ -122,6 +125,7 @@ when: - crictl.stat.exists - container_manager == "containerd" + - ansible_facts.services['containerd.service'] is defined rescue: - name: reset | force remove all cri pods (rescue)