ansible_slurm/tasks/slurmd.yml

48 lines
1012 B
YAML

---
- name: Install Slurm execution host packages (apt)
apt:
name: "{{ item }}"
state: "{{ 'latest' if slurm_upgrade else 'present' }}"
when: ansible_os_family == "Debian"
with_items:
- slurm-wlm
- name: Install Slurm execution host packages (yum)
yum:
name: "{{ item }}"
state: "{{ 'latest' if slurm_upgrade else 'present' }}"
with_items:
- munge
- slurm
- slurm-slurmd
when: ansible_os_family == "RedHat"
- name: Create slurm spool directory
file:
path: "{{ slurmd_spool_dir }}"
owner: root
group: root
mode: 0755
state: directory
notify:
- reload slurmd
- name: Create slurm log directory
file:
path: "/var/log/{{ slurm_log_dir_name }}"
owner: slurm
group: slurm
mode: 0755
state: directory
- name: Create cgroup.conf
copy:
content: |
CgroupAutomount=yes
ConstrainCores=yes
ConstrainRAMSpace=yes
ConstrainSwapSpace=yes
dest: "{{ slurm_conf_dir }}/cgroup.conf"
backup: yes