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>
pull/7101/head
Guillaume Abrioux 2022-02-21 17:12:06 +01:00
parent 9d87fd87cb
commit f08129edf2
1 changed files with 9 additions and 1 deletions

View File

@ -6,7 +6,7 @@
hosts: localhost hosts: localhost
gather_facts: false gather_facts: false
any_errors_fatal: true
vars_prompt: vars_prompt:
- name: ireallymeanit - name: ireallymeanit
prompt: Are you sure you want to switch from non-containerized to containerized ceph daemons? prompt: Are you sure you want to switch from non-containerized to containerized ceph daemons?
@ -14,6 +14,14 @@
private: no private: no
tasks: 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? - name: exit playbook, if user did not mean to switch from non-containerized to containerized daemons?
fail: fail:
msg: > msg: >