55 become : yes
66 vars :
77 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) }}"
89 server_node_ip : " {{ os_metadata.meta.k3s_server }}"
910
1011 resolv_conf_nameservers : [1.1.1.1, 8.8.8.8]
4142 openhpc_conf_server : " {{ server_node_ip }}"
4243
4344 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+
4450 - name : Configure resolve.conf
4551 block :
4652 - name : Set nameservers in /etc/resolv.conf
6571 name : NetworkManager
6672 state : reloaded
6773 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
6977
7078
7179 - name : Mount /mnt/cluster on compute nodes and copy hosts to /etc/hosts
9199 owner : root
92100 group : root
93101 mode : 0644
102+ when : iam_slurm_compute | bool
94103
95104 # - name: Include hostvars from NFS share
96105 # block:
103112 # - name: Include vars from NFS mount
104113 # include_vars:
105114 # file: "/mnt/cluster/{{ short_hostname.stdout }}/hostvars.yml"
115+ # when: iam_slurm_compute | bool
106116
107117
108118 - name : NFS client mount
121131 fstype : nfs
122132 state : " {{ item.get('nfs_client_mnt_state', nfs_client_mnt_state) }}"
123133 loop : " {{ nfs_configurations }}"
134+ when : iam_slurm_compute | bool
124135
125136
126137 - name : Manila mount
205216 loop_control :
206217 label : " {{ item.share_name }}"
207218 when : item.mount_state | default(os_manila_mount_state) in ['mounted' or 'ephemeral']
219+ when : iam_slurm_compute | bool
208220
209221
210222 - name : Basic users setup
229241 loop_control :
230242 label : " {{ item.name }}"
231243 when : " 'sudo' in item"
244+ when : iam_slurm_compute | bool
232245
233246
234247 - name : Configure EESSI
245258 - name : Ensure CVMFS config is setup
246259 command :
247260 cmd : " cvmfs_config setup"
261+ when : iam_slurm_compute | bool
248262
249263
250264 - name : Configure openhpc
285299 service :
286300 name : slurmd
287301 enabled : true
288- state : started
302+ state : started
303+ when : iam_slurm_compute | bool
0 commit comments