forked from ibab/salt-cluster
-
Notifications
You must be signed in to change notification settings - Fork 3
/
init.sls
129 lines (113 loc) · 2.84 KB
/
init.sls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# State munge has to be included to allow dependency on munge package
include:
- .munge
- .ubuntu-utopic
- .ssh
- .screen
{% if grains['host'] == pillar['slurm']['controller'] %}
- .slurmdbd
{% endif %}
# The SLURM scheduling system
/etc/slurm-llnl/slurm.conf:
file.managed:
- source: salt://slurm/files/etc/slurm-llnl/slurm.conf
- template: jinja
/etc/slurm-llnl/cgroup.conf:
file.managed:
- source: salt://slurm/files/etc/slurm-llnl/cgroup.conf
/etc/slurm-llnl/slurm.cert:
file.managed:
- source: salt://slurm/files/etc/slurm-llnl/slurm.cert
- mode: 400
# FIXME can the next 2 be factored?
/var/spool/slurm-llnl:
file.directory:
- group: slurm
- user: slurm
- require:
- user: slurm
/var/spool/slurm-llnl/cgroup:
file.directory:
- group: slurm
- user: slurm
- require:
- user: slurm
{% if grains['host'] != pillar['slurm']['controller'] %}
/var/log/slurm-llnl/slurm.log:
file.managed:
- group: slurm
- user: slurm
- require:
- user: slurm
{% endif %}
# specific to SLURM Controller
{% if grains['host'] == pillar['slurm']['controller'] %}
/etc/slurm-llnl/slurm.key:
file.managed:
- source: salt://slurm/files/etc/slurm-llnl/slurm.key
- mode: 400
## Unused because of slurmdbd
#/var/log/slurm-llnl/accounting.log:
# file.managed:
# - group: slurm
# - user: slurm
# - require:
# - user: slurm
#
#/var/log/slurm-llnl/job_completions.log:
# file.managed:
# - group: slurm
# - user: slurm
# - require:
# - user: slurm
/var/log/slurm-llnl/slurmctld.log:
file.managed:
- group: slurm
- user: slurm
- require:
- user: slurm
/var/log/slurm-llnl/sched.log:
file.managed:
- group: slurm
- user: slurm
- require:
- user: slurm
{% endif %}
# TODO handle different names given distro (slurm, slurm-llnl, ...)
slurm:
group.present:
- system: True
- gid: 97
user.present:
- fullname: SLURM daemon user account
- uid: 97
- gid_from_name: True
- system: True
- home: /var/spool/slurm-llnl
- shell: /bin/true
pkg.installed:
- name: slurm-llnl
service.running:
- name: slurm-llnl
- watch:
- user: slurm
- pkg: slurm
- pkg: slurm-plugins
- pkg: munge
- file: /etc/slurm-llnl/slurm.conf
- file: /var/spool/slurm-llnl
{% if grains['host'] == pillar['slurm']['controller'] %}
- file: /var/log/slurm-llnl/sched.log
- file: /var/log/slurm-llnl/slurmctld.log
- pkg: slurmdbd
{% endif %}
slurm-plugins:
pkg.installed:
- name: slurm-llnl-basic-plugins
/etc/slurm-llnl/gres.conf:
file.managed:
{% if grains['host'] in [ "bardolph", "monal01", "monal02"] %}
- source: salt://slurm/files/etc/slurm-llnl/{{ grains['host'] }}/gres.conf
{% else %}
- source: salt://slurm/files/etc/slurm-llnl/default/gres.conf
{% endif %}