installMungeFromSource.yml 2.43 KB
Newer Older
1
2
3
- name: test if munge is already isntalled
  stat: path="{{ munge_dir }}/bin/munge"
  register: munge_binary
4

5
- name: Create munge src directory if it does not exist
6
7
8
9
10
11
12
13
14
  file:
    path: "{{ munge_src_dir | dirname }}"
    state: directory
    owner: "{{ ansible_user }}"
    group: root
    mode: u=rwx,g=rx,o=rx
  become: true


15
16
17
18
19
20
21
22
23
- name: define munge_src_url
  set_fact:
    munge_src_url: "http://consistency0/src/munge-{{ munge_version }}.tar.bz2"
  when: munge_src_url is not defined

- name: download munge
  get_url:
    url: "{{ munge_src_url }}"
    checksum: "{{ munge_src_checksum }}"
24
    dest: "{{ munge_src_dir | dirname }}/munge_src"
25
26
  when: munge_src_checksum is defined and not munge_binary.stat.exists

27
28
29
- name: download munge
  get_url:
    url: "{{ munge_src_url }}"
30
    dest: "{{ munge_src_dir | dirname }}/munge_src"
31
  when: munge_src_checksum is not defined and not munge_binary.stat.exists
32
33


34
35
- name: unarchive munge
  unarchive:
36
37
    src: "{{ munge_src_dir | dirname }}/munge_src"
    dest: "{{ munge_src_dir | dirname }}"
38
39
    remote_src: yes
    creates: "{{ munge_src_dir }}"
40
  when: not munge_binary.stat.exists
41

Andreas Hamacher's avatar
Andreas Hamacher committed
42
43
44
45
46
47
48
49
50
- name: installing dependencies
  package:
    name:
      - libgcrypt-devel
      - libtool
      - automake
      - autoconf
    state: present
  become: true
51

52
- name: build munge
53
  shell: ./bootstrap && ./configure --prefix={{ munge_dir }} && make
54
  args:
55
56
    chdir: "{{ munge_src_dir }}"
    creates: "{{ munge_src_dir }}/src/munge/munge"
57
  when: not munge_binary.stat.exists
58
59
60

- name: install munge
  shell: make install
61
  become: true
62
  args:
63
    chdir: "{{ munge_src_dir }}"
64
    creates: "{{ munge_dir }}/bin/munge"
65
  when: not munge_binary.stat.exists
66

67
- name: set use_systemd Redhat
68
  set_fact:
Chris Hines's avatar
Chris Hines committed
69
    use_systemd: True
70
  when: (ansible_distribution == "CentOS" or ansible_distribution == "RedHat") and ( ansible_distribution_major_version == "7")
Chris Hines's avatar
Chris Hines committed
71

72
- name: set use_systemd Debian
73
  set_fact:
74
75
    use_systemd: True
  when: ansible_os_family == "Debian"
76

77
78
- name: copy init script
  template: dest=/etc/init.d/munge src=munge.initd.j2 mode=755
79
  become: true
80
  register: systemd_script_installed
Chris Hines's avatar
Chris Hines committed
81
  when: use_systemd is not defined
82
83

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

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