5
5
become : yes
6
6
vars :
7
7
os_metadata : " {{ lookup('url', 'http://169.254.169.254/openstack/latest/meta_data.json') | from_json }}"
8
+ iam_slurm_compute : " {{ os_metadata.meta.slurm_compute | default(false) }}"
8
9
server_node_ip : " {{ os_metadata.meta.k3s_server }}"
9
10
10
11
resolv_conf_nameservers : [1.1.1.1, 8.8.8.8]
41
42
openhpc_conf_server : " {{ server_node_ip }}"
42
43
43
44
tasks :
45
+ - name : Skip initialization if slurm_compute metadata set to false
46
+ debug :
47
+ msg : " Skipping compute initialization"
48
+ when : not iam_slurm_compute | bool
49
+
44
50
- name : Configure resolve.conf
45
51
block :
46
52
- name : Set nameservers in /etc/resolv.conf
65
71
name : NetworkManager
66
72
state : reloaded
67
73
when : _copy_nm_config.changed | default(false)
68
- when : resolv_conf_nameservers is defined and resolv_conf_nameservers | length > 0
74
+ when :
75
+ - resolv_conf_nameservers is defined and resolv_conf_nameservers | length > 0
76
+ - iam_slurm_compute | bool
69
77
70
78
71
79
- name : Mount /mnt/cluster on compute nodes and copy hosts to /etc/hosts
91
99
owner : root
92
100
group : root
93
101
mode : 0644
102
+ when : iam_slurm_compute | bool
94
103
95
104
# - name: Include hostvars from NFS share
96
105
# block:
103
112
# - name: Include vars from NFS mount
104
113
# include_vars:
105
114
# file: "/mnt/cluster/{{ short_hostname.stdout }}/hostvars.yml"
115
+ # when: iam_slurm_compute | bool
106
116
107
117
108
118
- name : NFS client mount
121
131
fstype : nfs
122
132
state : " {{ item.get('nfs_client_mnt_state', nfs_client_mnt_state) }}"
123
133
loop : " {{ nfs_configurations }}"
134
+ when : iam_slurm_compute | bool
124
135
125
136
126
137
- name : Manila mount
205
216
loop_control :
206
217
label : " {{ item.share_name }}"
207
218
when : item.mount_state | default(os_manila_mount_state) in ['mounted' or 'ephemeral']
219
+ when : iam_slurm_compute | bool
208
220
209
221
210
222
- name : Basic users setup
229
241
loop_control :
230
242
label : " {{ item.name }}"
231
243
when : " 'sudo' in item"
244
+ when : iam_slurm_compute | bool
232
245
233
246
234
247
- name : Configure EESSI
245
258
- name : Ensure CVMFS config is setup
246
259
command :
247
260
cmd : " cvmfs_config setup"
261
+ when : iam_slurm_compute | bool
248
262
249
263
250
264
- name : Configure openhpc
285
299
service :
286
300
name : slurmd
287
301
enabled : true
288
- state : started
302
+ state : started
303
+ when : iam_slurm_compute | bool
0 commit comments