From 3f44293f699c68c4b955962caa988540f355d233 Mon Sep 17 00:00:00 2001 From: k8s-infra-cherrypick-robot <90416843+k8s-infra-cherrypick-robot@users.noreply.github.com> Date: Tue, 15 Oct 2024 19:31:03 -0700 Subject: [PATCH] Fix: cannot stop & remove all cri containers via remove_node.yml (#11637) Before adding these changes, `ansible_facts.services["containerd.service"]` will not defined and fail to check for triggering the container stop and delete behaviors. Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com> Co-authored-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com> --- playbooks/remove_node.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/playbooks/remove_node.yml b/playbooks/remove_node.yml index f994dae43..ae5aba6be 100644 --- a/playbooks/remove_node.yml +++ b/playbooks/remove_node.yml @@ -27,6 +27,10 @@ hosts: "{{ node | default('kube_node') }}" gather_facts: false environment: "{{ proxy_disable_env }}" + pre_tasks: + - name: Gather information about installed services + service_facts: + when: reset_nodes | default(True) | bool roles: - { role: kubespray-defaults, when: reset_nodes | default(True) | bool } - { role: remove-node/pre-remove, tags: pre-remove }