use pre_tasks and post_tasks in shrink-mon.yml too

This commit should've been part of commit
2fb12ae554.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
(cherry picked from commit 2034387f57)
pull/4348/head
Rishabh Dave 2019-06-15 17:37:13 +05:30 committed by mergify[bot]
parent f08408bf5c
commit b28ed96378
1 changed files with 3 additions and 3 deletions

View File

@ -32,8 +32,7 @@
vars: vars:
mon_group_name: mons mon_group_name: mons
tasks: pre_tasks:
# pre task for following import
- name: exit playbook, if only one monitor is present in cluster - name: exit playbook, if only one monitor is present in cluster
fail: fail:
msg: "You are about to shrink the only monitor present in the cluster. msg: "You are about to shrink the only monitor present in the cluster.
@ -67,7 +66,7 @@
- import_role: - import_role:
name: ceph-facts name: ceph-facts
# post_tasks for preceding import tasks:
- name: pick a monitor different than the one we want to remove - name: pick a monitor different than the one we want to remove
set_fact: set_fact:
mon_host: "{{ item }}" mon_host: "{{ item }}"
@ -110,6 +109,7 @@
failed_when: false failed_when: false
delegate_to: "{{ mon_host }}" delegate_to: "{{ mon_host }}"
post_tasks:
# NOTE (leseb): sorry for the 'sleep' command # NOTE (leseb): sorry for the 'sleep' command
# but it will take a couple of seconds for other monitors # but it will take a couple of seconds for other monitors
# to notice that one member has left. # to notice that one member has left.