sap.sap_operations.pcs_status_info (1.25.0) — module

Get pacemaker status information

| "added in version" 1.4.0-galaxy of sap.sap_operations"

Authors: Kirill Satarin (@kksat)

Install collection

Install with ansible-galaxy collection install sap.sap_operations:==1.25.0


Add to requirements.yml

  collections:
    - name: sap.sap_operations
      version: 1.25.0

Description

Get pacemaker status information

This module will execute command C(pcs status xml) and process results to present them nicely in Ansible

If pacemaker is not running, or ansible user does not have authorizations to execution C(pcs status xml) command, module will fail

Recommended to use C(root) user

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get pacemaker status
  sap.sap_operations.pcs_status_info:
  become: true
  become_user: root

Outputs

pacemaker_status:
  description: Pacemaker status information in a dictionary
  returned: success
  sample: "{\n\"crm_mon\": {\n    \"nodes\": [\n        {\n            \"node\": {\n\
    \                \"expected_up\": \"true\",\n                \"id\": \"1\",\n\
    \                \"is_dc\": \"false\",\n                \"maintenance\": \"false\"\
    ,\n                \"name\": \"host1\",\n                \"online\": \"true\"\
    ,\n                \"pending\": \"false\",\n                \"resources_running\"\
    : \"0\",\n                \"shutdown\": \"false\",\n                \"standby\"\
    : \"false\",\n                \"standby_onfail\": \"false\",\n               \
    \ \"type\": \"member\",\n                \"unclean\": \"false\"\n            }\n\
    \        },\n        {\n            \"node\": {\n                \"expected_up\"\
    : \"true\",\n                \"id\": \"2\",\n                \"is_dc\": \"true\"\
    ,\n                \"maintenance\": \"false\",\n                \"name\": \"host2\"\
    ,\n                \"online\": \"true\",\n                \"pending\": \"false\"\
    ,\n                \"resources_running\": \"0\",\n                \"shutdown\"\
    : \"false\",\n                \"standby\": \"false\",\n                \"standby_onfail\"\
    : \"false\",\n                \"type\": \"member\",\n                \"unclean\"\
    : \"false\"\n            }\n        }\n    ],\n    \"summary\": {\n        \"\
    cluster_options\": {\n            \"maintenance-mode\": \"false\",\n         \
    \   \"no-quorum-policy\": \"stop\",\n            \"priority-fencing-delay-ms\"\
    : \"0\",\n            \"stonith-enabled\": \"true\",\n            \"stonith-timeout-ms\"\
    : \"60000\",\n            \"stop-all-resources\": \"false\",\n            \"symmetric-cluster\"\
    : \"true\"\n        },\n        \"current_dc\": {\n            \"id\": \"2\",\n\
    \            \"name\": \"host2\",\n            \"present\": \"true\",\n      \
    \      \"version\": \"2.1.2-4.el8_6.5-ada5c3b36e2\",\n            \"with_quorum\"\
    : \"true\"\n        },\n        \"last_change\": {\n            \"client\": \"\
    crmd\",\n            \"origin\": \"host1\",\n            \"time\": \"Wed May \
    \ 3 18:13:41 2023\",\n            \"user\": \"hacluster\"\n        },\n      \
    \  \"last_update\": {\n            \"time\": \"Thu May  4 09:47:15 2023\"\n  \
    \      },\n        \"nodes_configured\": {\n            \"number\": \"2\"\n  \
    \      },\n        \"resources_configured\": {\n            \"blocked\": \"0\"\
    ,\n            \"disabled\": \"0\",\n            \"number\": \"0\"\n        },\n\
    \        \"stack\": {\n            \"type\": \"corosync\"\n        }\n    },\n\
    \    \"version\": \"2.1.2-4.el8_6.5\"\n    }\n}"
  type: dict