ondrejhome.ha_cluster.pcs_constraint_location (1.0.2) — module

wrapper module for 'pcs constraint location'

| "added in version" 2.4 of ondrejhome.ha_cluster"

Authors: Ondrej Famera (@OndrejHome)

preview | supported by community

Install collection

Install with ansible-galaxy collection install ondrejhome.ha_cluster:==1.0.2


Add to requirements.yml

  collections:
    - name: ondrejhome.ha_cluster
      version: 1.0.2

Description

module for creating and deleting clusters location constraints using 'pcs' utility

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: resource resA prefers to run on node1
  pcs_constraint_location:
    resource: 'resA'
    node_name: 'node1'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: remove constraint where resource resA prefers to run on node1
  pcs_constraint_location:
    resource: 'resA'
    node_name: 'node1'
    state: 'absent'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: resource resB avoids running on node2
  pcs_constraint_location:
    resource: 'resB'
    node_name: 'node2'
    score: '-INFINITY'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: remove constraint where resource resB avoids running on node2
  pcs_constraint_location:
    resource: 'resB'
    node_name: 'node2'
    score: '-INFINITY'
    state: 'absent'

Inputs

    
score:
    default: INFINITY
    description:
    - constraint score in range -INFINITY..0..INFINITY
    required: false
    type: str

state:
    choices:
    - present
    - absent
    default: present
    description:
    - '''present'' - ensure that cluster constraint exists'
    - '''absent'' - ensure cluster constraints doesn''t exist'
    required: false
    type: str

cib_file:
    description:
    - Apply changes to specified file containing cluster CIB instead of running cluster.
    - This module requires the file to already contain cluster configuration.
    required: false
    type: str

resource:
    description:
    - resource for constraint
    required: true
    type: str

node_name:
    description:
    - node name for constraints
    required: true
    type: str