12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- # 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: Include common variables
- include_vars: ../../slurm_common/vars/main.yml
- - name: Copy slurm conf from buffer
- copy:
- src: "{{ buffer_path }}"
- dest: "{{ slurm_confpth }}"
- mode: "{{ slurm_mode }}"
- - name: Enable slurmdbd on manager
- service:
- name: slurmdbd
- state: restarted
- tags: install
- - name: Start slurmctld on manager
- systemd:
- name: slurmctld
- state: started
- tags: install
- - name: Show cluster if exists
- command: sacctmgr -n show cluster {{ cluster_name }}
- register: slurm_clusterlist
- changed_when: false
- - name: Create slurm cluster
- command: sacctmgr -i add cluster {{ cluster_name }}
- when: slurm_clusterlist.stdout.find(cluster_name) == 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={{ cluster_name }} Description="Default Account" Organization="Default Org"
- when: account_added.stdout.find(cluster_name) == 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(cluster_name) == 1
- tags: install
|