# Copyright 2020 Dell Inc. or its subsidiaries. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. --- - name: Include common variables include_vars: ../../slurm_manager/vars/main.yml - name: Copy slurm conf from buffer copy: src: "{{ buffer_path }}" dest: "{{ slurm_confpth }}" mode: "{{ slurm_mode }}" - name: Start slurmctld on manager service: name: slurmctld enabled: yes tags: install - name: Enable slurmdbd on manager service: name: slurmdbd enabled: yes tags: install - name: Show cluster if exists command: sacctmgr -n show cluster {{ inventory_hostname }} register: slurm_clusterlist changed_when: false - name: Create slurm cluster command: sacctmgr -i add cluster {{ inventory_hostname }} when: slurm_clusterlist.stdout.find(inventory_hostname) == 1 - name: Show account command: sacctmgr show account register: account_added changed_when: false - name: Create default slurm group command: sacctmgr -i add account defaultgroup Cluster={{ inventory_hostname }} Description="Default Account" Organization="Default Org" when: account_added.stdout.find(inventory_hostname) == 1 tags: install - name: Check if user exists command: sacctmgr show user register: user_added changed_when: false - name: Add root to the default account command: sacctmgr -i add user root DefaultAccount=defaultgroup when: account_added.stdout.find(inventory_hostname) == 1 tags: install