sap.sap_operations.pcs_config_checks role – Run pcs cluster checks

Note

This role is part of the sap.sap_operations collection.

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it use: ansible-galaxy collection install sap.sap_operations.

To use it in a playbook, specify: sap.sap_operations.pcs_config_checks.

Entry point main – Run pcs cluster checks

Synopsis

Parameters

Parameter

Comments

pcs_config_checks_architecture

string

Overwrite architecture collected by ansible_facts

Choices:

  • "x86_64"

  • "ppc64le"

pcs_config_checks_custom

list / elements=dictionary

List of custom checks

Default: []

architectures

list / elements=string

List of architectures on which check will be executed

Default: ["x86_64", "ppc64le"]

cloud_providers

list / elements=string

List of cloud providers on which check will be executed

Default: ["azure", "aws", "gcp"]

condition

list / elements=string

Condition to run check

Conditions should use only variables that are provided in checks execution context.

ansible_facts and cluster_properties variables are provided in checks execution context.

ansible_facts are collected for the host where role is executed, so if you are analyzing local xml export of the cluster CIB, ansible_facts will be collected for the host where you are running the role (for instance localhost).

More variables will be provided in checks execution context.

Checks are automatically filtered based on the following criteria ‘architecture’ variable - either provided as role parameter, or collected from ansible_facts ‘platform’ and ‘version’ variables - either provided as role parameters, or collected from ansible_facts ‘cloud_provider’ - not yet supported. Checks filtered out this way will not be even in the main check loop.

Another way to filter checks is to use tags. See pcs_config_checks_tags_exclude parameter.

If there is a more complex condition when to execute check and when not, this condition should be provided individually for each check in parameter when. For instance, this is how to ignore checks on an odd numbered day. {% raw %} name: This check will be executed only on even numbered days and will fail. condition: false when: “{{ ansible_facts[‘date_time’][‘day’] | int % 2 == 0 }}” {% endraw %} Check will be marked as skipped and not executed if ‘when’ condition is false. But this check will appear in list of checks.

Default: []

documentation

string

Documentation for the check

fail_msg

string

Message to print if check fails

Default: "FAILED"

ignore_errors

boolean

True if errors should be ignored

False if errors should be raised

Choices:

  • false ← (default)

  • true

name

string / required

Name of the check

platforms

list / elements=dictionary

Platform on which check will be executed

Platform specification as in ansible collections meta/main.yml file

Default: [{"name": "EL", "version": "7"}, {"name": "EL", "version": "8"}, {"name": "EL", "version": "9"}]

priority

string

Priority of the check

Choices:

  • "high"

  • "medium" ← (default)

  • "low"

quiet

boolean

If this is true, the check will be executed quietly

Choices:

  • false

  • true ← (default)

remediation

string

Remediation for the check

severity

string

Severity of the check

Choices:

  • "error"

  • "warning" ← (default)

  • "info"

success_msg

string

Message to print if check succeeds

Default: "PASSED"

tags

list / elements=string

Tags for the check

Default: ["cluster", "pcs"]

when

boolean

If this condition is true, the check will be executed

Choices:

  • false

  • true ← (default)

pcs_config_checks_custom_only

boolean

If this is True, only custom checks pcs_config_checks_custom will be executed

If this is False, preconfigured and custom checks will be executed

Choices:

  • false ← (default)

  • true

pcs_config_checks_loop_display

string

Indicate what will be displayed in loop when executing checks

Choices:

  • "name" ← (default)

  • "condition"

  • "documentation"

  • "remediation"

  • "fail_msg"

  • "success_msg"

  • "priority"

  • "severity"

  • "when"

  • "quiet"

  • "tags"

  • "architectures"

  • "platforms"

  • "cloud_providers"

pcs_config_checks_mode

string

Role execution mode

Debug provides more information about the checks and execution context

Assert is the default mode

Choices:

  • "assert" ← (default)

  • "debug"

pcs_config_checks_platform

dictionary

Overwrite platform collected by ansible_facts

name

string / required

Name of the platform

Choices:

  • "EL"

version

string / required

Version of the platform

Choices:

  • "7"

  • "8"

  • "9"

pcs_config_checks_preconfigured

list / elements=dictionary

List of preconfigured checks

Default: []

architectures

list / elements=string

List of architectures on which check will be executed

Default: ["x86_64", "ppc64le"]

cloud_providers

list / elements=string

List of cloud providers on which check will be executed

Default: ["azure", "aws", "gcp"]

condition

list / elements=string

Condition to run check

Conditions should use only variables that are provided in checks execution context.

ansible_facts and cluster_properties variables are provided in checks execution context.

ansible_facts are collected for the host where role is executed, so if you are analyzing local xml export of the cluster CIB, ansible_facts will be collected for the host where you are running the role (for instance localhost).

More variables will be provided in checks execution context.

Checks are automatically filtered based on the following criteria ‘architecture’ variable - either provided as role parameter, or collected from ansible_facts ‘platform’ and ‘version’ variables - either provided as role parameters, or collected from ansible_facts ‘cloud_provider’ - not yet supported. Checks filtered out this way will not be even in the main check loop.

Another way to filter checks is to use tags. See pcs_config_checks_tags_exclude parameter.

If there is a more complex condition when to execute check and when not, this condition should be provided individually for each check in parameter when. For instance, this is how to ignore checks on an odd numbered day. {% raw %} name: This check will be executed only on even numbered days and will fail. condition: false when: “{{ ansible_facts[‘date_time’][‘day’] | int % 2 == 0 }}” {% endraw %} Check will be marked as skipped and not executed if ‘when’ condition is false. But this check will appear in list of checks.

Default: []

documentation

string

Documentation for the check

fail_msg

string

Message to print if check fails

Default: "FAILED"

ignore_errors

boolean

True if errors should be ignored

False if errors should be raised

Choices:

  • false ← (default)

  • true

name

string / required

Name of the check

platforms

list / elements=dictionary

Platform on which check will be executed

Platform specification as in ansible collections meta/main.yml file

Default: [{"name": "EL", "version": "7"}, {"name": "EL", "version": "8"}, {"name": "EL", "version": "9"}]

priority

string

Priority of the check

Choices:

  • "high"

  • "medium" ← (default)

  • "low"

quiet

boolean

If this is true, the check will be executed quietly

Choices:

  • false

  • true ← (default)

remediation

string

Remediation for the check

severity

string

Severity of the check

Choices:

  • "error"

  • "warning" ← (default)

  • "info"

success_msg

string

Message to print if check succeeds

Default: "PASSED"

tags

list / elements=string

Tags for the check

Default: ["cluster", "pcs"]

when

boolean

If this condition is true, the check will be executed

Choices:

  • false

  • true ← (default)

pcs_config_checks_tags_exclude

list / elements=string

List of tags to exclude

If check has tag from this list, it will not run

Checks with tag ‘skip’ will never run

Only first **five** elements from this list are used, all other are ignored

Default: ["skip"]

pcs_config_checks_verbose

boolean

If this True, more information will be provided in output.

Affects both debug and assert modes

If set to True quiet parameter for all checks will be ignored, effectively making check.quiet false for all checks.

If set to False check.quiet parameter will be used.

Choices:

  • false ← (default)

  • true