Skip to content

Commit e198ec4

Browse files
committed
make munge key optional again to ease testing
1 parent 483b0ac commit e198ec4

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ each list element:
4242

4343
Note slurm's ["configless" mode](https://slurm.schedmd.com/configless_slurm.html) is always used.
4444

45-
`openhpc_munge_key`: Required. Define a munge key to use.
45+
`openhpc_munge_key`: Optional. Define a munge key to use. If not provided then the package-generated one is used from the first host in the play.
4646

4747
`openhpc_login_only_nodes`: Optional. The name of an ansible inventory group containing nodes which are login nodes (i.e. not also control nodes). These nodes must have `openhpc_enable.batch: true` and will run `slurmd` to contact the control node for config.
4848

tasks/runtime.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,23 @@
1111
loop: "{{ openhpc_directories }}"
1212
when: inventory_hostname == openhpc_slurm_control_host
1313

14+
- name: Read package-generated Munge key
15+
slurp:
16+
src: /etc/munge/munge.key
17+
register: _ohpc_munge_key_file
18+
run_once: true
19+
1420
- name: Write Munge key
1521
copy:
16-
content: "{{ openhpc_munge_key }}"
22+
content: "{{ openhpc_munge_key | default(_ohpc_package_munge_key) }}"
1723
dest: "/etc/munge/munge.key"
1824
owner: munge
1925
group: munge
2026
mode: 0400
2127
notify:
2228
- Restart Munge service
29+
vars:
30+
_ohpc_package_munge_key: "{{ hostvars[ ansible_play_hosts | first ]._ohpc_munge_key_file.content | b64decode }}"
2331

2432
- name: Template slurmdbd.conf
2533
template:

0 commit comments

Comments
 (0)