Skip to content
Snippets Groups Projects
installMungeFromSource.yml 1.52 KiB
Newer Older
- name: test if munge is already isntalled
  stat: path="{{ munge_dir }}/bin/munge"
  register: munge_binary
    src: "http://consistency0/src/munge-{{ munge_version }}.tar.bz2"
    copy: no
    dest: /tmp
Andreas Hamacher's avatar
Andreas Hamacher committed
    creates: /tmp/munge-{{ munge_version }}/configure
  when: not munge_binary.stat.exists
- name: build munge
  shell: ./configure --prefix={{ munge_dir }} && make
  args:
Andreas Hamacher's avatar
Andreas Hamacher committed
    chdir: /tmp/munge-{{ munge_version }}
    creates: /tmp/munge-{{ munge_version }}/src/munge/munge
  when: not munge_binary.stat.exists
Andreas Hamacher's avatar
Andreas Hamacher committed
    chdir: /tmp/munge-{{ munge_version }}
  when: not munge_binary.stat.exists
- name: set use_systemd Redhat
Chris Hines's avatar
Chris Hines committed
  set_fact: 
    use_systemd: True
  when: (ansible_distribution == "CentOS" or ansible_distribution == "RedHat") and ( ansible_distribution_major_version == "7") 
Chris Hines's avatar
Chris Hines committed

- name: set use_systemd Debian
  set_fact: 
    use_systemd: True
  when: ansible_os_family == "Debian"
  
- name: copy init script
  template: dest=/etc/init.d/munge src=munge.initd.j2 mode=755
  register: systemd_script_installed
Chris Hines's avatar
Chris Hines committed
  when: use_systemd is not defined

- name:  copy slurm init script if OS contains systemd
  template: dest=/etc/systemd/system/munge.service src=munge.service.j2 mode=644
Chris Hines's avatar
Chris Hines committed
  when: use_systemd is defined

- name: reload systemd
  shell: systemctl daemon-reload
Ubuntu's avatar
Ubuntu committed
  when: use_systemd is defined and systemd_script_installed.changed