---
- name: Configure slurm
  template: src=slurm/templates/slurm.conf.j2 dest=/etc/{{slurm_name}}/slurm.conf owner=root group=root mode=0644
  notify: restart slurm
  tags: 
    - slurm

- name: Ensure main slurm directories exist
  file: path={{item}} state=directory owner=slurm
  with_items:
    - /var/lib/{{slurm_name}}/checkpoint
    - /var/lib/{{slurm_name}}/slurmctld
    - /var/lib/{{slurm_name}}/slurmd
    - /var/log/{{slurm_name}}
    - /var/run/{{slurm_name}}

- name: Ensure SLURM is running
  service: name={{slurm_name}} state=started
  tags: 
    - slurm

