---
  - service: name=firewalld state=stopped
    when: ansible_os_family == "RedHat" and ansible_distribution_major_version|int >= 7
    ignore_errors: yes

  - name: copy slurm.conf file from the frontend
    copy: src=/usr/local/etc/slurm.conf dest=/usr/local/etc/slurm.conf

    # start SLURM daemon
  - name: Start Slurm Daemon
    become: true
    become_user: slurm
    command: slurmd

  - name: Reconfigure SLURM
    become: true
    become_user: slurm
    command: scontrol reconfigure

---
  - service: name=firewalld state=stopped
    when: ansible_os_family == "RedHat" and ansible_distribution_major_version|int >= 7
    ignore_errors: yes

  - name: copy slurm.conf file from the frontend
    copy: src=/usr/local/etc/slurm.conf dest=/usr/local/etc/slurm.conf

    # start SLURM daemon
  - name: Start Slurm Daemon
    command: slurmd

  - name: Reconfigure SLURM
    command: scontrol reconfigure

Change user for slurm services
Change user for slurm services
