Skip to content
Snippets Groups Projects
Commit 554bf7f7 authored by Chris Hines's avatar Chris Hines
Browse files

only install munge if it isn't already installed

parent 47400f52
No related branches found
No related tags found
1 merge request!69only install munge if it isn't already installed
- name: test if munge is already isntalled
stat: path="{{ munge_dir }}/bin/munge"
register: munge_binary
- name: unarchive munge - name: unarchive munge
unarchive: unarchive:
...@@ -6,6 +9,7 @@ ...@@ -6,6 +9,7 @@
copy: no copy: no
dest: /tmp dest: /tmp
creates: /tmp/munge-{{ munge_version }}/configure creates: /tmp/munge-{{ munge_version }}/configure
when: not munge_binary.stat.exists
- name: build munge - name: build munge
...@@ -13,6 +17,7 @@ ...@@ -13,6 +17,7 @@
args: args:
chdir: /tmp/munge-{{ munge_version }} chdir: /tmp/munge-{{ munge_version }}
creates: /tmp/munge-{{ munge_version }}/src/munge/munge creates: /tmp/munge-{{ munge_version }}/src/munge/munge
when: not munge_binary.stat.exists
- name: install munge - name: install munge
shell: make install shell: make install
...@@ -20,15 +25,17 @@ ...@@ -20,15 +25,17 @@
args: args:
chdir: /tmp/munge-{{ munge_version }} chdir: /tmp/munge-{{ munge_version }}
creates: "{{ munge_dir }}/bin/munge" creates: "{{ munge_dir }}/bin/munge"
when: not munge_binary.stat.exists
- name: set use_systemd - name: set use_systemd
set_fact: set_fact:
use_systemd: True use_systemd: True
when: (ansible_distribution == "CentOS" or ansible_distribution == "RedHat") and ( ansible_distribution_major_version == "7") when: (ansible_distribution == "CentOS" or ansible_distribution == "RedHat") and ( ansible_distribution_major_version == "7") and not munge_binary.stat.exists
- name: copy init script - name: copy init script
template: dest=/etc/init.d/munge src=munge.initd.j2 mode=755 template: dest=/etc/init.d/munge src=munge.initd.j2 mode=755
sudo: true sudo: true
register: systemd_script_installed
when: use_systemd is not defined when: use_systemd is not defined
- name: copy slurm init script if OS contains systemd - name: copy slurm init script if OS contains systemd
...@@ -39,4 +46,4 @@ ...@@ -39,4 +46,4 @@
- name: reload systemd - name: reload systemd
shell: systemctl daemon-reload shell: systemctl daemon-reload
sudo: true sudo: true
when: use_systemd is defined when: use_systemd is defined and systemd_script_installed|changed
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment