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)
changes/06/806906/1
Yadnesh Kulkarni 1 year ago
parent 8365aa780a
commit d6f3a5c742
  1. 2
      playbooks/pacemaker-status.yaml
  2. 5
      roles/pacemaker_status/tasks/main.yml
  3. 2
      roles/pacemaker_status/vars/main.yml

@ -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:

@ -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

@ -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

Loading…
Cancel
Save