ondrejhome.ha_cluster.pcs_constraint_colocation (1.0.2) — module

wrapper module for 'pcs constraint colocation'

| "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 colocation constraints using 'pcs' utility

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: prefer resA and resB to run on same node
  pcs_constraint_colocation:
    resource1: 'resA'
    resource2: 'resB'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: prefer resA to run on same node as Master resource of resB-master resource
  pcs_constraint_colocation:
    resource1: 'resA'
    resource2: 'resB-master'
    resource2_role: 'Master'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: remove colocation constraint that prefer resA to run on same node as Master resource of resB-master resource
  pcs_constraint_colocation:
    resource1: 'resA'
    resource2: 'resB-master'
    resource2_role: 'Master'
    state: 'absent'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: prefer resA and resB to run on same node but do not move resA if resB fails
  pcs_constraint_colocation:
    resource1: 'resA'
    resource2: 'resB'
    influenece: false

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

influence:
    default: true
    description:
    - constraint influence (since pcs version 0.11)
    required: false
    type: bool

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

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

resource1_role:
    choices:
    - Master
    - Slave
    - Started
    default: Started
    description:
    - Role of resource1
    required: false
    type: str

resource2_role:
    choices:
    - Master
    - Slave
    - Started
    default: Started
    description:
    - Role of resource2
    required: false
    type: str