diff --git a/resources/playbook/roles/bibigrid/tasks/042-slurm-server.yml b/resources/playbook/roles/bibigrid/tasks/042-slurm-server.yml index 69f0098f..580aabc4 100644 --- a/resources/playbook/roles/bibigrid/tasks/042-slurm-server.yml +++ b/resources/playbook/roles/bibigrid/tasks/042-slurm-server.yml @@ -70,22 +70,6 @@ - slurmdbd - slurmrestd -- name: Enable slurmdbd and slurmrestd services - systemd: - name: "{{ item }}" - enabled: true - masked: false - state: started - daemon_reload: true - with_items: - - slurmdbd - - slurmrestd - -- name: Start slurm explicit after all dependencies are configured - systemd: - name: slurmctld - state: started - - name: Register Slurm users home dir shell: "set -o pipefail && grep slurm /etc/passwd | cut -d ':' -f 6" register: slurm_home @@ -180,6 +164,31 @@ groups: - ansible +- name: Generate location specific worker userdata + template: + src: slurm/worker_userdata.j2 + dest: "/opt/slurm/userdata_{{ hostvars[item].cloud_identifier }}.txt" + owner: slurm + group: ansible + mode: "0640" + with_items: "{{ groups.vpngtw + groups.master }}" + +- name: Enable slurmdbd and slurmrestd services + systemd: + name: "{{ item }}" + enabled: true + masked: false + state: started + daemon_reload: true + with_items: + - slurmdbd + - slurmrestd + +- name: Start slurm explicit after all dependencies are configured + systemd: + name: slurmctld + state: started + - when: slurm_home.stdout != '/opt/slurm' block: @@ -210,12 +219,3 @@ - slurmd - slurmdbd - slurmrestd - -- name: Generate location specific worker userdata - template: - src: slurm/worker_userdata.j2 - dest: "/opt/slurm/userdata_{{ hostvars[item].cloud_identifier }}.txt" - owner: slurm - group: ansible - mode: "0640" - with_items: "{{ groups.vpngtw + groups.master }}"