Files
portfolio/platform-projects/hpc-slurm-ai-cluster/playbooks/lifecycle/show-slurm-node.yml
T
Mateusz Suski d300d490f5
lint / shell-yaml-ansible (push) Failing after 47s
Add Slurm AI/HPC cluster platform project
2026-06-04 19:42:45 +00:00

34 lines
852 B
YAML

---
- name: Show Slurm node state
hosts: slurm_controller
become: true
gather_facts: false
tasks:
- name: Require target_node
ansible.builtin.fail:
msg: "Use: ansible-playbook show-slurm-node.yml -e target_node=<hostname>"
when: target_node is not defined
- name: Show node state
ansible.builtin.shell: |
set -euo pipefail
echo "### sinfo"
sinfo -N -n {{ target_node }} || true
echo
echo "### scontrol"
scontrol show node {{ target_node }} || true
echo
echo "### jobs on node"
squeue -w {{ target_node }} || true
args:
executable: /bin/bash
register: node_lifecycle_state
changed_when: false
- name: Print node lifecycle state
ansible.builtin.debug:
var: node_lifecycle_state.stdout_lines