2017-06-01 13:52:44 -03:00
|
|
|
---
|
|
|
|
|
2019-01-29 22:26:21 -04:00
|
|
|
- name: Install Slurm execution host packages
|
|
|
|
package:
|
|
|
|
name: "{{ __slurm_packages.slurmd }}"
|
2018-04-17 16:37:35 -03:00
|
|
|
state: "{{ 'latest' if slurm_upgrade else 'present' }}"
|
2017-06-01 13:52:44 -03:00
|
|
|
|
|
|
|
- name: Create slurm spool directory
|
|
|
|
file:
|
2019-01-29 22:26:21 -04:00
|
|
|
path: "{{ __slurm_config_merged.SlurmdSpoolDir }}"
|
2017-06-01 13:52:44 -03:00
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0755
|
|
|
|
state: directory
|
2019-01-29 22:26:21 -04:00
|
|
|
when: slurm_create_dirs
|
2017-06-01 13:52:44 -03:00
|
|
|
notify:
|
|
|
|
- reload slurmd
|
2018-04-17 20:28:48 -03:00
|
|
|
|
|
|
|
- name: Create slurm log directory
|
|
|
|
file:
|
2019-01-29 22:26:21 -04:00
|
|
|
path: "{{ __slurm_config_merged.SlurmdLogFile | dirname }}"
|
|
|
|
owner: "{{ __slurm_user_name }}"
|
|
|
|
group: "{{ __slurm_group_name }}"
|
2018-04-17 20:28:48 -03:00
|
|
|
mode: 0755
|
|
|
|
state: directory
|
2019-10-04 14:54:12 -03:00
|
|
|
when: slurm_create_dirs and __slurm_config_merged.SlurmdLogFile != omit
|
2019-01-29 22:26:21 -04:00
|
|
|
|
|
|
|
- name: Include config dir creation tasks
|
|
|
|
include_tasks: _inc_create_config_dir.yml
|
|
|
|
when: slurm_create_dirs
|
2018-04-27 12:03:26 -03:00
|
|
|
|
2019-01-29 22:26:21 -04:00
|
|
|
- name: Install extra execution host configs
|
|
|
|
template:
|
|
|
|
src: generic.conf.j2
|
|
|
|
dest: "{{ slurm_config_dir }}/{{ item.name }}"
|
2018-04-27 12:03:26 -03:00
|
|
|
backup: yes
|
2019-01-29 22:26:21 -04:00
|
|
|
with_items:
|
|
|
|
- name: cgroup.conf
|
|
|
|
config: slurm_cgroup_config
|
|
|
|
when: item.config in vars
|
2021-06-18 02:26:00 -03:00
|
|
|
|
|
|
|
|
|
|
|
- name: 'Service slurmd : Directory of Pidfile must exist and set slurm group permission'
|
|
|
|
lineinfile:
|
|
|
|
path: /lib/systemd/system/slurmd.service
|
|
|
|
regexp: '{{ item.regexp }}'
|
|
|
|
line: "{{ item.line }}"
|
|
|
|
insertafter: '\[Service\]'
|
|
|
|
loop:
|
|
|
|
- line: 'RuntimeDirectory={{ __slurm_config_merged.SlurmdPidFile.split("/")[-2] }}'
|
|
|
|
regexp: '^RuntimeDirectory'
|
|
|
|
- line: "Group={{ __slurm_group_name }}"
|
|
|
|
regexp: '^Group'
|
|
|
|
- line: 'RuntimeDirectoryMode=0770'
|
|
|
|
regexp: '^RuntimeDirectoryMode'
|
|
|
|
notify:
|
|
|
|
- systemd reload
|
|
|
|
- reload slurmdbd
|
|
|
|
when: ansible_distribution == 'Debian'
|
|
|
|
|
|
|
|
- name: Service slurmctld , option PIDFile
|
|
|
|
lineinfile:
|
|
|
|
path: /lib/systemd/system/slurmd.service
|
|
|
|
regexp: 'PIDFile'
|
|
|
|
line: "PIDFile={{ __slurm_config_merged.SlurmdPidFile }}"
|
|
|
|
insertafter: '\[Service\]'
|
|
|
|
when: __slurm_config_merged.SlurmdPidFile is defined
|
|
|
|
notify:
|
|
|
|
- systemd reload
|
|
|
|
- reload slurmdbd
|