Fail validation if pacemaker service is not active

Pacemaker-status validation always reports success regardless
of the actual status of the service.

Add a task to fail validation when pacemaker service is found
inactive/failed

Closes-Bug: #1940519

Signed-off-by: Yadnesh Kulkarni <ykulkarn@redhat.com>
Change-Id: Id8d99321c870aee70f0e177b1b633654a04c8402
(cherry picked from commit 2a7c43df4a)
This commit is contained in:
Yadnesh Kulkarni 2021-08-19 16:33:28 +05:30
parent 8365aa780a
commit d6f3a5c742
3 changed files with 9 additions and 0 deletions

View File

@ -9,6 +9,8 @@
A failed status post-deployment indicates something is not configured
correctly. This should also be run before upgrade as the process will
likely fail with a cluster that's not completely healthy.
This validation fails if pacemaker service is found failed or inactive.
groups:
- post-deployment
roles:

View File

@ -6,6 +6,11 @@
changed_when: false
ignore_errors: true
- name: Check pacemaker service is inactive or failed
fail:
msg: "Pacemaker service found {{ check_service.stdout.split('=')[-1] }}"
when: check_service.stdout != 'ActiveState=active'
- when: "check_service.stdout == 'ActiveState=active'"
block:
- name: Get pacemaker status

View File

@ -7,5 +7,7 @@ metadata:
A failed status post-deployment indicates something is not configured
correctly. This should also be run before upgrade as the process will
likely fail with a cluster that's not completely healthy.
This validation fails if pacemaker service is found failed or inactive.
groups:
- post-deployment