12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- # 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: Install packages for slurm
- package:
- name: "{{ slurm_packages }}"
- state: present
- with_items:
- - "{{ slurm_packages }}"
- tags: install
- - name: Install development tools
- package:
- name: "{{ item | join (',') }}"
- state: present
- with_items:
- - "{{ dev_tools }}"
- tags: install
- - name: Create temporary download folder for slurm
- file:
- path: "{{ tmp_path }}"
- owner: slurm
- group: slurm
- mode: "{{ tmp_mode }}"
- state: directory
- - name: Download slurm source
- get_url:
- url: "{{ slurm_url }}"
- dest: "{{ tmp_path }}"
- checksum: "{{ slurm_md5 }}"
- validate_certs: no
- tags: install
- - name: Build slurm rpms
- command: rpmbuild -ta "{{ rpmbuild_path }}"
- changed_when: false
- args:
- warn: no
- - name: Verify package md5
- command: rpm -qa
- ignore_errors: true
- register: verify_result
- changed_when: no
- failed_when: no
- args:
- warn: no
- - name: Install rpms
- command: rpm -Uvh ~"{{ rpm_loop }}"
- args:
- chdir: "{{ rpm_path }}"
- warn: no
- when: verify_result.rc != 0
- - name: Add socket and core info
- lineinfile:
- path: "{{ slurm_confpth }}"
- regexp: "NodeName= Sockets= CoresPerSocket="
- line: "NodeName={{ group_names[0] }} Sockets={{ hostvars[inventory_hostname]['ansible_facts']['processor_count'] }}
- CoresPerSocket={{ hostvars[inventory_hostname]['ansible_facts']['processor_cores'] }}"
- - name: Save slurm conf in buffer
- fetch:
- src: "{{ slurm_confpth }}"
- dest: "{{ buffer_path }}"
- flat: true
- - name: Start slurmd on compute nodes
- service:
- name: slurmd.service
- enabled: yes
- tags: install
|