<commit_before>---
- name: ensure slurm rpms and dependencies are present
  when: not is_container is defined
  yum: pkg={{ item }} state=present
  tags: 
  - slurm
  - rpm
  with_items:
     - slurm

- name: create slurm group
  tags:
  - user
  - slurm
  action: group name=slurm gid=5000 system=no

- name: create slurm user
  tags:
  - user
  - slurm
  action: user name=slurm group=slurm shell=/bin/false uid=5000 createhome=no home=/opt/slurm

- name: create a slurm config dir
  tags: slurm
  file: path=/etc/slurm/ mode=0755 state=directory

- name: create slurm dirs
  tags: slurm
  file: path=/var/{{ item }}/slurm/ owner=slurm mode=0755 state=directory
  with_items:
    - lib
    - log
    - run

- name: create slurm directories
  tags: slurm
  file: path=/var/spool/slurmd owner=slurm mode=0755 state=directory

- name: enable munged service
  tags: slurm
  supervisorctl: name=munged state=started


- name: configure slurm (master)
  action: template src=usr/local/etc/{{ slurm_conf_template }} dest=/usr/local/etc/slurm.conf owner=root group=root mode=0644
  when: is_master is defined 
  tags: 
  - slurm
  - cfg
  notify: restart slurmctld

- name: configure slurmctld (master)
  action: template src=usr/local/etc/slurm.conf.j2 dest=/usr/local/etc/slurm.conf owner=root group=root mode=0644
  when: is_container is defined and is_master is defined 
  tags: 
  - slurm
  - cfg
  notify: restart slurmctld

- name: configure slurm (client)
  action: template src=usr/local/etc/slurm.conf.j2 dest=/usr/local/etc/slurm.conf owner=root group=root mode=0644
  when: not is_container is defined and is_master is defined 
  tags:
  - slurm
  - cfg
  notify: restart slurmd


- name: create slurm directories
  tags: slurm
  file: path=/var/spool/slurmd owner=slurm mode=0755 state=directory

- name: configure slurm (client)
  action: template src=usr/local/etc/slurm_docker.conf.j2 dest=/usr/local/etc/slurm.conf owner=root group=root mode=0644
  when: is_container is defined 
  tags:
  - slurm
  - cfg
  notify: restart slurmd


- name: LD_LIBRARY_PATH to find libmunge
  tags:
    - env
  lineinfile:
    dest=/etc/bashrc
    line="export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib/"
    regexp=".*export LD_LIBRARY_PATH="
    owner=root
    state=present
    insertafter=EOF
    create=True

<commit_msg>slurm-setup now knows about docker<commit_after>---
- name: ensure slurm rpms and dependencies are present
  when: not is_container is defined
  yum: pkg={{ item }} state=present
  tags: 
  - slurm
  - rpm
  with_items:
     - slurm

- name: create slurm group
  tags:
  - user
  - slurm
  action: group name=slurm gid=5000 system=no

- name: create slurm user
  tags:
  - user
  - slurm
  action: user name=slurm group=slurm shell=/bin/false uid=5000 createhome=no home=/opt/slurm

- name: create a slurm config dir
  tags: slurm
  file: path=/etc/slurm/ mode=0755 state=directory

- name: create slurm dirs
  tags: slurm
  file: path=/var/{{ item }}/slurm/ owner=slurm mode=0755 state=directory
  with_items:
    - lib
    - log
    - run

- name: create slurm directories
  tags: slurm
  file: path=/var/spool/slurmd owner=slurm mode=0755 state=directory

- name: restart munged service
  tags: 
  - slurm
  supervisorctl: name=munged state=restarted


- name: configure slurm (master)
  action: template src=usr/local/etc/{{ slurm_conf_template }} dest=/usr/local/etc/slurm.conf owner=root group=root mode=0644
  when: is_master is defined 
  tags: 
  - slurm
  - cfg
  notify: restart slurmctld

- name: configure slurmctld (master)
  action: template src=usr/local/etc/slurm.conf.j2 dest=/usr/local/etc/slurm.conf owner=root group=root mode=0644
  when: is_container is defined and is_master is defined 
  tags: 
  - slurm
  - cfg
  notify: restart slurmctld

- name: create slurm directories
  tags: slurm
  file: path=/var/spool/slurmd owner=slurm mode=0755 state=directory

- name: configure slurmctld and slurmd (master)
  action: template src=usr/local/etc/{{ slurm_conf_template }} dest=/usr/local/etc/slurm.conf owner=root group=root mode=0644
  when: is_master is defined 
  tags: 
  - slurm
  - cfg
  notify: 
  - restart slurmctld

- name: configure slurmd
  action: template src=usr/local/etc/{{ slurm_conf_template }} dest=/usr/local/etc/slurm.conf owner=root group=root mode=0644
  when: not is_master is defined 
  tags: 
  - slurm
  - cfg
  notify: restart slurmd

- name: LD_LIBRARY_PATH to find libmunge
  tags:
    - env
  lineinfile:
    dest=/etc/bashrc
    line="export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib/"
    regexp=".*export LD_LIBRARY_PATH="
    owner=root
    state=present
    insertafter=EOF
    create=True


{'fraction_non_alphanumeric': 0.10179257362355953, 'fraction_numerical': 0.01792573623559539, 'mean_word_length': 3.4009389671361503, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '502351', 'n_tokens_mistral': 1770, 'n_tokens_neox': 1736, 'n_words': 445}