From 98cdb5348c083166159f871d5f426f51e99f2be8 Mon Sep 17 00:00:00 2001 From: Max Gautier Date: Mon, 20 Jan 2025 10:35:23 +0100 Subject: [PATCH] verify settings: fix etcd assertion when implicity etcd group When the etcd group is not specified we assume it's kube_control_plane. In that case, etcd still can't be even, so instead of only checking the etcd group we need to default to kube_control_plane --- roles/kubernetes/preinstall/tasks/0040-verify-settings.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/kubernetes/preinstall/tasks/0040-verify-settings.yml b/roles/kubernetes/preinstall/tasks/0040-verify-settings.yml index e45eae7c0..ade00a13c 100644 --- a/roles/kubernetes/preinstall/tasks/0040-verify-settings.yml +++ b/roles/kubernetes/preinstall/tasks/0040-verify-settings.yml @@ -74,10 +74,10 @@ - name: Stop if even number of etcd hosts assert: - that: groups.etcd | length is not divisibleby 2 + that: groups.get('etcd', groups.kube_control_plane) | length is not divisibleby 2 + run_once: true when: - not ignore_assert_errors - - inventory_hostname in groups.get('etcd',[]) - name: Stop if memory is too small for control plane nodes assert: