tripleo-validations/validations/pacemaker-status.yaml

31 lines
972 B
YAML

---
- hosts: Controller
vars:
metadata:
name: Check the status of the pacemaker cluster
description: >
This runs `pcs status` and checks for any failed actions.
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.
groups:
- post-deployment
tasks:
- name: Check pacemaker service is running
become: True
command: "/usr/bin/systemctl show pacemaker --property ActiveState"
register: check_service
changed_when: False
ignore_errors: True
- when: "check_service.stdout == 'ActiveState=active'"
block:
- name: Get pacemaker status
become: true
command: pcs status xml
register: pcs_status
changed_when: False
- name: Check pacemaker status
pacemaker: status="{{ pcs_status.stdout }}"