Skip to content

Commit b970ab6

Browse files
committed
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 <gabrioux@redhat.com> (cherry picked from commit f08129e)
1 parent c0da98b commit b970ab6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,22 @@
66
hosts: localhost
77

88
gather_facts: false
9-
9+
any_errors_fatal: true
1010
vars_prompt:
1111
- name: ireallymeanit
1212
prompt: Are you sure you want to switch from non-containerized to containerized ceph daemons?
1313
default: 'no'
1414
private: no
1515

1616
tasks:
17+
- import_role:
18+
name: ceph-defaults
19+
20+
- name: fail when less than three monitors
21+
fail:
22+
msg: "This playbook requires at least three monitors."
23+
when: groups[mon_group_name] | length | int < 3
24+
1725
- name: exit playbook, if user did not mean to switch from non-containerized to containerized daemons?
1826
fail:
1927
msg: >

0 commit comments

Comments
 (0)