-
Notifications
You must be signed in to change notification settings - Fork 47
/
main.yml
96 lines (83 loc) · 3.62 KB
/
main.yml
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
---
slurm_upgrade: false
slurm_roles: []
slurm_partitions: []
slurm_nodes: []
slurm_config_dir: "{{ '/etc/slurm-llnl' if __slurm_llnl else '/etc/slurm' }}"
slurm_create_user: "{{ __slurm_redhat }}"
slurm_create_dirs: "{{ __slurm_redhat }}"
slurm_rotate_logs: "{{ __slurm_redhat }}"
slurm_configure_munge: true
# Service names are the same on both distros since ??
slurmd_service_name: slurmd
slurmctld_service_name: slurmctld
slurmdbd_service_name: slurmdbd
#Cluster name for slurm config. This is required to correctly setup slurmdbd and attune it to the slurm config.
__slurm_cluster_name: cluster
__cluster_not_setup: true #Default value. Is modified if cluster already exists.
slurm_start_services: true
__slurm_user_name: "{{ (slurm_user | default({})).name | default('slurm') }}"
# TODO: this could be incorrect, use the group collection from galaxyproject.galaxy
__slurm_group_name: "{{ (slurm_user | default({})).group | default(omit) }}"
__slurm_run_dir: >-
{{
((ansible_distribution == 'Ubuntu' and ansible_distribution_major_version is version('20', '<')) or
(ansible_distribution == 'Debian' and ansible_distribution_major_version is version('10', '<')))
| ternary('/var/run/slurm-llnl', '/run')
}}
__slurm_llnl: >-
{{
(ansible_distribution == 'Ubuntu' and ansible_distribution_major_version is version('22', '<')) or
(ansible_distribution == 'Debian' and ansible_distribution_major_version is version('11', '<'))
}}
__slurm_log_dir: "{{ __slurm_llnl | ternary('/var/log/slurm-llnl', '/var/log/slurm') }}"
__slurm_debian: "{{ ansible_os_family == 'Debian' }}"
__slurm_redhat: "{{ ansible_os_family == 'RedHat' }}"
__slurm_config_default:
AuthType: auth/munge
CryptoType: crypto/munge
SlurmUser: "{{ __slurm_user_name }}"
ClusterName: "{{ __slurm_cluster_name }}"
# default is proctrack/cgroup which is the best but also less than 100% chance of working e.g. in docker
ProctrackType: proctrack/pgid
# slurmctld options
SlurmctldPort: 6817
SlurmctldLogFile: "{{ __slurm_log_dir ~ '/slurmctld.log' if __slurm_debian else omit }}"
SlurmctldPidFile: "{{ __slurm_run_dir ~ '/slurmctld.pid' if __slurm_debian else omit }}"
StateSaveLocation: >-
{{
'/var/lib/slurm-llnl/slurmctld' if __slurm_llnl else (
'/var/lib/slurm/slurmctld' if __slurm_debian else (
'/var/spool/slurm/ctld' if __slurm_redhat else
omit))
}}
# slurmd options
SlurmdPort: 6818
SlurmdLogFile: "{{ __slurm_log_dir ~ '/slurmd.log' if __slurm_debian else omit }}"
SlurmdPidFile: "{{ __slurm_run_dir ~ '/slurmd.pid' if __slurm_debian else omit }}"
SlurmdSpoolDir: >-
{{
'/var/lib/slurm-llnl/slurmctld' if __slurm_llnl else (
'/var/lib/slurm/slurmctld' if __slurm_debian else (
'/var/spool/slurm/d' if __slurm_redhat else
omit))
}}
__slurm_config_merged: "{{ __slurm_config_default | combine(slurm_config | default({})) }}"
__slurm_debian_packages:
client: [slurm-client, slurm-wlm-doc]
slurmctld: [slurm-wlm]
slurmd: [slurm-wlm]
slurmdbd: [slurmdbd]
__slurm_redhat_packages:
client: [slurm, munge]
slurmctld: [munge, slurm, slurm-slurmctld]
slurmd: [munge, slurm, slurm-slurmd]
slurmdbd: [munge, slurm-slurmdbd]
__slurm_packages: "{{ __slurm_debian_packages if __slurm_debian else __slurm_redhat_packages }}"
__slurmdbd_config_default:
AuthType: auth/munge
DbdPort: 6819
SlurmUser: "{{ __slurm_user_name }}"
SlurmctldPidFile: "{{ __slurm_run_dir ~ '/slurmdbd.pid' if __slurm_debian else omit }}"
LogFile: "{{ __slurm_log_dir ~ '/slurmdbd.log' if __slurm_debian else omit }}"
__slurmdbd_config_merged: "{{ __slurmdbd_config_default | combine(slurmdbd_config | default({})) }}"