Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a munge key if it does not exist #46

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions tasks/munge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,31 @@
mode: 0700
state: directory

- name: Check if munge key exists
delegate_to: localhost
become: false
stat:
path: "{{ slurm_munge_key }}"
register:
mungekey
run_once: true
when: slurm_munge_key is defined

- name: Create munge key
command: sudo -u munge mungekey
args:
creates: "{{ slurm_munge_key }}"
run_once: true
when: slurm_munge_key is defined and not mungekey.stat.exists

- name: Fetch munge key
fetch:
src: /etc/munge/munge.key
dest: "{{ slurm_munge_key }}"
flat: yes
run_once: true
when: slurm_munge_key is defined and not mungekey.stat.exists

- name: Install munge key
ansible.builtin.copy:
src: "{{ slurm_munge_key }}"
Expand Down
Loading