sap.sap_operations.pcs_cluster_property_mapping (1.25.0) — filter

Get pcs cluster property from pcs_cib_info result

| "added in version" 1.6.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 pcs cluster property from pcs_cib_info result

This module expects result of M(sap.sap_operations.pcs_cib_info) module as input value

If property does not exists, empty dictionary will be returned

By default this filter will return only cluster properties from 'cib-bootstrap-options' cluster property set

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get cluster CIB
  sap.sap_operations.pcs_cib_info:
  register: pcs_cib_info
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get cluster name from pcs_cib_info several ways
  ansible.builtin.debug:
    msg:
      - "Cluster name - {{ ( pcs_cib_info | sap.sap_operations.pcs_cluster_property_mapping(name='cluster-name') )['cluster-name'] }}"
      - "Cluster name - {{ ( pcs_cib_info | sap.sap_operations.pcs_cluster_property_mapping(id='cib-bootstrap-options-cluster-name') )['cluster-name'] }}"
      - "Cluster name - {{ ( pcs_cib_info | sap.sap_operations.pcs_cluster_property_mapping )['cluster-name'] }}"
      - >
        When you provide some different input result will be empty dictionary.
        See {{ ('not pcs_cib output' | sap.sap_operations.pcs_cluster_property_mapping is mapping) == true }}"

Inputs

    
id:
    description:
    - Id of the cluster property.
    required: false
    type: str

name:
    description:
    - Name of the cluster property.
    required: false
    type: str

value:
    description: Result of sap.sap_operations.pcs_cib_info module execution
    required: true
    type: dict

cluster_property_set_id:
    default: cib-bootstrap-options
    description: ID of cluster property set to filter
    required: false
    type: str

Outputs

data:
  description:
  - pcs cluster property object (nvpair)
  - all return value are empty strings if property does not exists
  - empty dictionary will be returned for any failure
  example:
    cluster-infrastructure: corosync
    cluster-name: my-cluster
    dc-version: 2.1.6-8.el8-6fdc9deea29
    have-watchdog: 'false'
    stonith-watchdog-timeout: '0'
  returned: Success
  type: dict