From 8096e4f4ceaeedd4e22a92f8e51ad985c7644468 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Mon, 21 Feb 2022 17:12:06 +0100 Subject: [PATCH] switch2containers: fail if less than 3 monitors This playbook doesn't support less than 3 monitors present in the inventory. Just like the rolling_update playbook, let's fail if less than 3 monitors are present. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2049132 Signed-off-by: Guillaume Abrioux (cherry picked from commit f08129edf2efb8bad21043b7e90af59e6f3e1a8d) --- ...non-containerized-to-containerized-ceph-daemons.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml index e43647216..d07e271d0 100644 --- a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml +++ b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml @@ -6,7 +6,7 @@ hosts: localhost gather_facts: false - + any_errors_fatal: true vars_prompt: - name: ireallymeanit prompt: Are you sure you want to switch from non-containerized to containerized ceph daemons? @@ -14,6 +14,14 @@ private: no tasks: + - import_role: + name: ceph-defaults + + - name: fail when less than three monitors + fail: + msg: "This playbook requires at least three monitors." + when: groups[mon_group_name] | length | int < 3 + - name: exit playbook, if user did not mean to switch from non-containerized to containerized daemons? fail: msg: > -- 2.39.5