community.general.pacemaker_resource module – Manage pacemaker resources

Note

This module is part of the community.general collection (version 11.3.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

Specify the resource name to create or clone to.

This is required if state=present, state=absent, state=enabled, or state=disabled.

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_clone_ids

list / elements=string

added in community.general 11.3.0

List of clone resource IDs to clone from.

resource_clone_meta

list / elements=string

added in community.general 11.3.0

List of metadata to associate with clone resource.

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.

The states cleanup and cloned have been added in community.general 11.3.0.

If state=cloned or state=present, you can set resource_clone_ids and resource_clone_meta to determine exactly what and how to clone.

Choices:

  • "present" ← (default)

  • "absent"

  • "cloned"

  • "enabled"

  • "disabled"

  • "cleanup"

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

Returns 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)