2017-06-01 13:52:44 -03:00
|
|
|
---
|
|
|
|
|
2019-01-29 22:26:21 -04:00
|
|
|
- name: Install Slurm DB packages
|
|
|
|
package:
|
|
|
|
name: "{{ __slurm_packages.slurmdbd }}"
|
2018-04-17 16:37:35 -03:00
|
|
|
state: "{{ 'latest' if slurm_upgrade else 'present' }}"
|
2017-06-01 13:52:44 -03:00
|
|
|
|
|
|
|
- name: Install slurmdbd.conf
|
|
|
|
template:
|
2019-01-29 22:26:21 -04:00
|
|
|
src: generic.conf.j2
|
2021-06-18 02:26:00 -03:00
|
|
|
dest: "{{ slurm_config_dir }}/{{ item.name }}"
|
2019-01-29 22:26:21 -04:00
|
|
|
owner: "{{ __slurm_user_name }}"
|
2017-06-01 13:52:44 -03:00
|
|
|
group: root
|
|
|
|
mode: 0400
|
2021-06-18 02:26:00 -03:00
|
|
|
with_items:
|
|
|
|
- name: slurmdbd.conf
|
|
|
|
config: __slurmdbd_config_merged
|
2017-06-01 13:52:44 -03:00
|
|
|
notify:
|
|
|
|
- reload slurmdbd
|
2019-01-29 22:26:21 -04:00
|
|
|
|
|
|
|
- name: Create slurm log directory
|
|
|
|
file:
|
|
|
|
path: "{{ __slurmdbd_config_merged.LogFile | dirname }}"
|
|
|
|
owner: "{{ __slurm_user_name }}"
|
|
|
|
group: "{{ __slurm_group_name }}"
|
|
|
|
mode: 0755
|
|
|
|
state: directory
|
2019-01-29 23:35:28 -04:00
|
|
|
when: slurm_create_dirs and __slurmdbd_config_merged.LogFile
|
2021-06-18 02:26:00 -03:00
|
|
|
|
|
|
|
- name: 'Service slurmdbd : Directory of Pidfile must exist and set slurm group permission'
|
|
|
|
lineinfile:
|
|
|
|
path: /lib/systemd/system/slurmdbd.service
|
|
|
|
regexp: '{{ item.regexp }}'
|
|
|
|
line: "{{ item.line }}"
|
|
|
|
insertafter: '\[Service\]'
|
|
|
|
loop:
|
|
|
|
- line : 'RuntimeDirectory={{ __slurmdbd_config_merged.PidFile.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 slurmdbd , option PIDFile
|
|
|
|
lineinfile:
|
|
|
|
path: /lib/systemd/system/slurmdbd.service
|
|
|
|
regexp: 'PIDFile'
|
|
|
|
line: "PIDFile={{ __slurmdbd_config_merged.PidFile }}"
|
|
|
|
insertafter: '\[Service\]'
|
|
|
|
when: __slurmdbd_config_merged.PidFile is defined
|
|
|
|
notify:
|
|
|
|
- systemd reload
|
|
|
|
- reload slurmdbd
|