jose_d.slurm.slurm_scontrol (0.0.31) — module

Module interacting with slurmctld using scontrol

| "added in version" 0.0.4 of jose_d.slurm"

Authors: Josef Dvoracek (@jose-d)

Install collection

Install with ansible-galaxy collection install jose_d.slurm:==0.0.31


Add to requirements.yml

  collections:
    - name: jose_d.slurm
      version: 0.0.31

Description

The slurm_scontrol module provides the capability

to modify or retrieve the state of a node within the Slurm workload

manager through the utilization of the scontrol command.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Read state of node n[2,3] and register result into nodes_state
  jose_d.slurm.slurm_scontrol:
    nodes:
      - n2
      - n3
  register: nodes_state
  delegate_to: slurmserver.url
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Drain nodes n2 and n3 and register resulting state into nodes_state
  jose_d.slurm.slurm_scontrol:
    nodes:
      - n2
      - n3
    new_state: DRAIN
    new_state_reason: Ansible testing
  register: nodes_state
  delegate_to: slurmserver.url

Inputs

    
nodes:
    description:
    - List of nodes for the purpose of reading or modifying their states.
    elements: str
    required: true
    type: list

new_state:
    description:
    - If specified, new_state will be configured at nodes.
    - available states DOWN,DRAIN,FAIL,FUTURE,NORESP,POWER_DOWN,POWER_DOWN_ASAP,POWER_DOWN_FORCE,POWER_UP,RESUME,UNDRAIN.
    required: false
    type: str

new_state_reason:
    description:
    - Reason to be used together with "drain" state
    - eg. 'node maintenance'
    required: false
    type: str

Outputs

data:
  description: The YAML output obtained from the scontrol command parsed into a dict.
  returned: always
  type: dict
reason_changed:
  description: If the Reason attribute of a node has been modified, this variable
    will be set to True.
  returned: always
  type: bool
scontrol_commands:
  description: List of scontrol commands used to change state of target node
  returned: always
  type: list
scontrol_update_ran:
  description: If scontrol update command was ran by module
  returned: always
  type: bool
state_changed:
  description: This variable is True when the State attribute of a node has been modified.
  returned: always
  type: bool