Create slurm log directory and rotate logs
This commit is contained in:
parent
388f666081
commit
1de5867980
|
@ -0,0 +1,23 @@
|
||||||
|
##
|
||||||
|
# Slurm Logrotate Configuration
|
||||||
|
##
|
||||||
|
/var/log/slurm/*.log {
|
||||||
|
compress
|
||||||
|
missingok
|
||||||
|
nocopytruncate
|
||||||
|
nocreate
|
||||||
|
nodelaycompress
|
||||||
|
nomail
|
||||||
|
notifempty
|
||||||
|
noolddir
|
||||||
|
rotate 5
|
||||||
|
sharedscripts
|
||||||
|
size=32M
|
||||||
|
create 640 slurm root
|
||||||
|
postrotate
|
||||||
|
for daemon in $(/usr/bin/scontrol show daemons)
|
||||||
|
do
|
||||||
|
killall -SIGUSR2 $daemon
|
||||||
|
done
|
||||||
|
endscript
|
||||||
|
}
|
|
@ -53,12 +53,18 @@
|
||||||
when: ansible_os_family == "RedHat"
|
when: ansible_os_family == "RedHat"
|
||||||
|
|
||||||
# As of 17.11, this is only created if you install the example configs package
|
# As of 17.11, this is only created if you install the example configs package
|
||||||
- name: Create /etc/slurm (yum)
|
- name: Create /etc/slurm
|
||||||
file:
|
file:
|
||||||
path: /etc/slurm
|
path: /etc/slurm
|
||||||
state: directory
|
state: directory
|
||||||
when: ansible_os_family == "RedHat"
|
when: ansible_os_family == "RedHat"
|
||||||
|
|
||||||
|
- name: Install log rotation configuration
|
||||||
|
copy:
|
||||||
|
src: logrotate-slurm
|
||||||
|
dest: /etc/logrotate.d/slurm
|
||||||
|
when: ansible_os_family == "RedHat"
|
||||||
|
|
||||||
# FIXME: this task will fail if slurmservers[0] has not already completed the slurm.conf task that follows it
|
# FIXME: this task will fail if slurmservers[0] has not already completed the slurm.conf task that follows it
|
||||||
- name: Acquire hostlist
|
- name: Acquire hostlist
|
||||||
command: scontrol show hostlist {{ groups[item.inventory_group] | join(",") }}
|
command: scontrol show hostlist {{ groups[item.inventory_group] | join(",") }}
|
||||||
|
|
|
@ -27,3 +27,11 @@
|
||||||
state: directory
|
state: directory
|
||||||
notify:
|
notify:
|
||||||
- reload slurmd
|
- reload slurmd
|
||||||
|
|
||||||
|
- name: Create slurm log directory
|
||||||
|
file:
|
||||||
|
path: "/var/log/{{ slurm_log_dir_name }}"
|
||||||
|
owner: slurm
|
||||||
|
group: slurm
|
||||||
|
mode: 0755
|
||||||
|
state: directory
|
||||||
|
|
Loading…
Reference in New Issue