sap.sap_operations.pcs_auth module – Module for managing cluster node authorization with ‘pcs auth’ commands

Note

This module 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_auth.

Synopsis

  • Module for managing cluster node authorization with ‘pcs auth’ commands

Parameters

Parameter

Comments

node_name

aliases: node, host, hostname

string / required

hostname of node for authentication

password

string

password for cluster authentication

pcsd_conf_filepath

path

path to pcsd configuration file

only required if pcsd configuration file is in unusual location or for testing

Default: ""

state

string

‘present’ authenticates the node while ‘absent’ will remove the node authentication

node from which this is run is (de)authenticated against the node specified in ‘node_name’

Choices:

  • "present" ← (default)

  • "absent"

username

string

username of user for cluster authentication

Default: "hacluster"

Notes

Note

  • This module is (de)authenticating nodes only 1-way == authenticating node 1 against node 2 doesn’t mean that node 2 is authenticated against node 1!

  • This module is community supported

  • Module interface (parameters, output) expected to be stable but not guaranteed

  • Module planned to be released on Ansible Automation Hub after collecting some feedback

  • There is no guarantee that this module will be officially supported by Red Hat

Examples

---
- name: Authorize node 'n1' with default user 'hacluster' and password 'testtest'
  sap.sap_operations.pcs_auth:
    node_name: 'n1'
    password: 'testtest'

- name: authorize all nodes in ansible play to each other
  sap.sap_operations.pcs_auth:
    node_name: "{{ hostvars[item]['ansible_hostname'] }}"
    password: 'testtest'
  with_items: "{{ play_hosts }}"

- name: de-authorize all nodes from each other in ansible play
  sap.sap_operations.pcs_auth:
    node_name: "{{  hostvars[item]['ansible_hostname'] }}"
    state: 'absent'
  with_items: "{{ play_hosts }}"

Authors

  • Ondrej Famera (@OndrejHome)

  • Kirill Satarin (@kksat)