Join AnsibleFest at Red Hat Summit!

community.general.pacemaker_resource module – Manage pacemaker resources

Note

This module is part of the community.general collection (version 10.5.0).

You might already have this collection installed if you are using the ansible package. 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 community.general.

To use it in a playbook, specify: community.general.pacemaker_resource.

New in community.general 10.5.0

Synopsis

  • This module can manage resources in a Pacemaker cluster using the pacemaker CLI.

Parameters

Parameter

Comments

name

string / required

Specify the resource name to create.

resource_argument

dictionary

Action to associate with resource.

argument_action

string

Action to apply to resource.

Choices:

  • "clone"

  • "master"

  • "group"

  • "promotable"

argument_option

list / elements=string

Options to associate with resource action.

resource_meta

list / elements=string

List of meta to associate with resource.

resource_operation

list / elements=dictionary

List of operations to associate with resource.

Default: []

operation_action

string

Operation action to associate with resource.

operation_option

list / elements=string

Operation option to associate with action.

resource_option

list / elements=string

Specify the resource option to create.

Default: []

resource_type

dictionary

Resource type to create.

resource_name

string

Specify the resource type name.

resource_provider

string

Specify the resource type providers.

resource_standard

string

Specify the resource type standard.

state

string

Indicate desired state for cluster resource.

Choices:

  • "present" ← (default)

  • "absent"

  • "enabled"

  • "disabled"

wait

integer

Timeout period for polling the resource creation.

Default: 300

Attributes

Attribute

Support

Description

check_mode

Support: full

Can run in check_mode and return changed status prediction without modifying target.

diff_mode

Support: none

Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode.

Examples

---
- name: Create pacemaker resource
  hosts: localhost
  gather_facts: false
  tasks:
    - name: Create virtual-ip resource
      community.general.pacemaker_resource:
        state: present
        name: virtual-ip
        resource_type:
          resource_name: IPaddr2
        resource_option:
          - "ip=[192.168.2.1]"
        resource_argument:
          argument_action: group
          argument_option:
            - master
        resource_operation:
          - operation_action: monitor
            operation_option:
              - interval=20

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

cluster_resources

string

The cluster resource output message.

Returned: always

Sample: "Assumed agent name ocf:heartbeat:IPaddr2 (deduced from IPaddr2)"

Authors

  • Dexter Le (@munchtoast)