|
@@ -0,0 +1,164 @@
|
|
|
|
+# 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: Install epel repository
|
|
|
|
+ package:
|
|
|
|
+ name: epel-release
|
|
|
|
+ state: present
|
|
|
|
+ tags: install
|
|
|
|
+
|
|
|
|
+- name: Munge installation
|
|
|
|
+ package:
|
|
|
|
+ name: munge-devel
|
|
|
|
+ enablerepo: PowerTools
|
|
|
|
+ state: present
|
|
|
|
+
|
|
|
|
+- name: Install packages for slurm
|
|
|
|
+ package:
|
|
|
|
+ name: "{{ item }}"
|
|
|
|
+ state: present
|
|
|
|
+ with_items:
|
|
|
|
+ - "{{ common_packages }}"
|
|
|
|
+ tags: install
|
|
|
|
+
|
|
|
|
+- name: Create munge key
|
|
|
|
+ command: "{{ munge_cmd }}"
|
|
|
|
+ changed_when: true
|
|
|
|
+
|
|
|
|
+- name: Copy munge key
|
|
|
|
+ copy:
|
|
|
|
+ src: munge.key
|
|
|
|
+ dest: "{{ munge_dest }}"
|
|
|
|
+ owner: munge
|
|
|
|
+ group: munge
|
|
|
|
+ mode: "{{ munge_mode }}"
|
|
|
|
+ tags: install
|
|
|
|
+
|
|
|
|
+- name: Slurm configuration - slurm.conf
|
|
|
|
+ copy:
|
|
|
|
+ src: slurm.conf
|
|
|
|
+ dest: "{{ slurm_dest }}"
|
|
|
|
+ mode: "{{ slurm_mode }}"
|
|
|
|
+ tags: install
|
|
|
|
+
|
|
|
|
+- name: Add cluster name
|
|
|
|
+ lineinfile:
|
|
|
|
+ path: "{{ slurm_confpth }}"
|
|
|
|
+ regexp: "ClusterName="
|
|
|
|
+ line: "ClusterName={{ cluster_name }}"
|
|
|
|
+
|
|
|
|
+- name: Add slurm user name
|
|
|
|
+ lineinfile:
|
|
|
|
+ path: "{{ slurm_confpth }}"
|
|
|
|
+ regexp: "SlurmUser="
|
|
|
|
+ line: "SlurmUser={{ slurm_user }}"
|
|
|
|
+
|
|
|
|
+- name: Add slurmctld port no
|
|
|
|
+ lineinfile:
|
|
|
|
+ path: "{{ slurm_confpth }}"
|
|
|
|
+ regexp: "SlurmctldPort="
|
|
|
|
+ line: "SlurmctldPort={{ slurmctld_port }}"
|
|
|
|
+
|
|
|
|
+- name: Add slurmd port no
|
|
|
|
+ lineinfile:
|
|
|
|
+ path: "{{ slurm_confpth }}"
|
|
|
|
+ regexp: "SlurmdPort="
|
|
|
|
+ line: "SlurmdPort={{ slurmd_port }}"
|
|
|
|
+
|
|
|
|
+- name: Add spool path
|
|
|
|
+ lineinfile:
|
|
|
|
+ path: "{{ slurm_confpth }}"
|
|
|
|
+ regexp: "SlurmdSpoolDir="
|
|
|
|
+ line: "SlurmdSpoolDir={{ spool_pth }}"
|
|
|
|
+
|
|
|
|
+- name: Add slurmctld pid file path
|
|
|
|
+ lineinfile:
|
|
|
|
+ path: "{{ slurm_confpth }}"
|
|
|
|
+ regexp: "SlurmctldPidFile="
|
|
|
|
+ line: "SlurmctldPidFile={{ slurmctld_pid }}"
|
|
|
|
+
|
|
|
|
+- name: Add slurmd pid file path
|
|
|
|
+ lineinfile:
|
|
|
|
+ path: "{{ slurm_confpth }}"
|
|
|
|
+ regexp: "SlurmdPidFile="
|
|
|
|
+ line: "SlurmdPidFile={{ slurmd_pid }}"
|
|
|
|
+
|
|
|
|
+- name: Add slurmctld log file path
|
|
|
|
+ lineinfile:
|
|
|
|
+ path: "{{ slurm_confpth }}"
|
|
|
|
+ regexp: "SlurmctldLogFile="
|
|
|
|
+ line: "SlurmctldLogFile={{ slurmctld_log }}"
|
|
|
|
+
|
|
|
|
+- name: Add slurmd log file path
|
|
|
|
+ lineinfile:
|
|
|
|
+ path: "{{ slurm_confpth }}"
|
|
|
|
+ regexp: "SlurmdLogFile="
|
|
|
|
+ line: "SlurmdLogFile={{ slurmd_log }}"
|
|
|
|
+
|
|
|
|
+- name: Create slurm group
|
|
|
|
+ group:
|
|
|
|
+ name: slurm
|
|
|
|
+ state: present
|
|
|
|
+ tags: install
|
|
|
|
+
|
|
|
|
+- name: Add the user 'slurm' with uid 6001 and a primary group of 'slurm'
|
|
|
|
+ user:
|
|
|
|
+ name: slurm
|
|
|
|
+ comment: Slurm User Account
|
|
|
|
+ uid: "{{ slurm_uid }}"
|
|
|
|
+ group: slurm
|
|
|
|
+ tags: install
|
|
|
|
+
|
|
|
|
+- name: Create slurm log directory
|
|
|
|
+ file:
|
|
|
|
+ path: "{{ slurm_logpth }}"
|
|
|
|
+ state: directory
|
|
|
|
+ owner: slurm
|
|
|
|
+ group: slurm
|
|
|
|
+ mode: "{{ gen_mode }}"
|
|
|
|
+ recurse: yes
|
|
|
|
+ tags: install
|
|
|
|
+
|
|
|
|
+- name: Give slurm user permission to spool
|
|
|
|
+ file:
|
|
|
|
+ path: "{{ spool_pth }}"
|
|
|
|
+ owner: slurm
|
|
|
|
+ group: slurm
|
|
|
|
+ state: directory
|
|
|
|
+ mode: "{{ gen_mode }}"
|
|
|
|
+ recurse: yes
|
|
|
|
+
|
|
|
|
+- name: Give slurm user permission to slurmctld
|
|
|
|
+ file:
|
|
|
|
+ path: "{{ slurmctld_pid }}"
|
|
|
|
+ owner: slurm
|
|
|
|
+ group: slurm
|
|
|
|
+ mode: "{{ gen_mode }}"
|
|
|
|
+ state: touch
|
|
|
|
+
|
|
|
|
+- name: Give slurm user permission to slurmd
|
|
|
|
+ file:
|
|
|
|
+ path: "{{ slurmd_pid }}"
|
|
|
|
+ owner: slurm
|
|
|
|
+ group: slurm
|
|
|
|
+ mode: "{{ gen_mode }}"
|
|
|
|
+ state: touch
|
|
|
|
+
|
|
|
|
+- name: Start munge service
|
|
|
|
+ service:
|
|
|
|
+ name: munge
|
|
|
|
+ state: restarted
|
|
|
|
+ enabled: yes
|
|
|
|
+ tags: install
|