|
@@ -1,4 +1,4 @@
|
|
-# Copyright 2020 Dell Inc. or its subsidiaries. All Rights Reserved.
|
|
|
|
|
|
+# Copyright 2022 Dell Inc. or its subsidiaries. All Rights Reserved.
|
|
#
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# you may not use this file except in compliance with the License.
|
|
@@ -12,6 +12,9 @@
|
|
# See the License for the specific language governing permissions and
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
# limitations under the License.
|
|
---
|
|
---
|
|
|
|
+- name: Saving distribution of os
|
|
|
|
+ set_fact:
|
|
|
|
+ compute_os: "{{ ansible_facts['distribution'] | lower }}"
|
|
|
|
|
|
- name: Create a custom fact directory on each host
|
|
- name: Create a custom fact directory on each host
|
|
file:
|
|
file:
|
|
@@ -27,76 +30,144 @@
|
|
group: root
|
|
group: root
|
|
mode: "{{ accelerator_discovery_script_mode }}"
|
|
mode: "{{ accelerator_discovery_script_mode }}"
|
|
|
|
|
|
-- name: Add epel-release repo
|
|
|
|
- package:
|
|
|
|
- name: epel-release
|
|
|
|
- state: present
|
|
|
|
- tags: install
|
|
|
|
|
|
+- block:
|
|
|
|
+ - name: Add epel-release repo
|
|
|
|
+ package:
|
|
|
|
+ name: epel-release
|
|
|
|
+ state: present
|
|
|
|
+ tags: install
|
|
|
|
+
|
|
|
|
+ - name: Add elrepo GPG key
|
|
|
|
+ rpm_key:
|
|
|
|
+ state: present
|
|
|
|
+ key: "{{ elrepo_gpg_key_url }}"
|
|
|
|
+ register: elrepo_gpg_key
|
|
|
|
+ until: elrepo_gpg_key is not failed
|
|
|
|
+ retries: "{{ max_retries }}"
|
|
|
|
+ delay: "{{ max_delay }}"
|
|
|
|
+ tags: install
|
|
|
|
|
|
-- name: Add elrepo GPG key
|
|
|
|
- rpm_key:
|
|
|
|
- state: present
|
|
|
|
- key: "{{ elrepo_gpg_key_url }}"
|
|
|
|
- register: elrepo_gpg_key
|
|
|
|
- until: elrepo_gpg_key is not failed
|
|
|
|
- retries: 20
|
|
|
|
- delay: 10
|
|
|
|
- tags: install
|
|
|
|
|
|
+ - name: Add elrepo (nvidia kmod drivers)
|
|
|
|
+ package:
|
|
|
|
+ name: "{{ elrepo_rpm_url }}"
|
|
|
|
+ state: present
|
|
|
|
+ register: elrepo
|
|
|
|
+ until: elrepo is not failed
|
|
|
|
+ retries: "{{ max_retries }}"
|
|
|
|
+ delay: "{{ max_delay }}"
|
|
|
|
+ tags: install
|
|
|
|
+
|
|
|
|
+ - name: Add docker community edition repository
|
|
|
|
+ get_url:
|
|
|
|
+ url: "{{ docker_repo_url }}"
|
|
|
|
+ dest: "{{ docker_repo_dest }}"
|
|
|
|
+ register: docker_repo
|
|
|
|
+ until: docker_repo is not failed
|
|
|
|
+ retries: "{{ max_retries }}"
|
|
|
|
+ delay: "{{ max_delay }}"
|
|
|
|
+ tags: install
|
|
|
|
|
|
-- name: Add elrepo (nvidia kmod drivers)
|
|
|
|
- package:
|
|
|
|
- name: "{{ elrepo_rpm_url }}"
|
|
|
|
- state: present
|
|
|
|
- register: elrepo
|
|
|
|
- until: elrepo is not failed
|
|
|
|
- retries: 20
|
|
|
|
- delay: 10
|
|
|
|
- tags: install
|
|
|
|
|
|
+ - name: Permanently Disable swap
|
|
|
|
+ mount:
|
|
|
|
+ name: "swap"
|
|
|
|
+ fstype: swap
|
|
|
|
+ state: absent
|
|
|
|
|
|
-- name: Add docker community edition repository
|
|
|
|
- get_url:
|
|
|
|
- url: "{{ docker_repo_url }}"
|
|
|
|
- dest: "{{ docker_repo_dest }}"
|
|
|
|
- register: docker_repo
|
|
|
|
- until: docker_repo is not failed
|
|
|
|
- retries: 20
|
|
|
|
- delay: 10
|
|
|
|
- tags: install
|
|
|
|
|
|
+ - name: Disable selinux
|
|
|
|
+ selinux:
|
|
|
|
+ state: disabled
|
|
|
|
+ tags: install
|
|
|
|
|
|
-- name: Permanently Disable swap
|
|
|
|
- mount:
|
|
|
|
- name: "swap"
|
|
|
|
- fstype: swap
|
|
|
|
- state: absent
|
|
|
|
|
|
+ - name: Install common packages
|
|
|
|
+ package:
|
|
|
|
+ name: "{{ common_packages }}"
|
|
|
|
+ state: present
|
|
|
|
+ tags: install
|
|
|
|
|
|
-- name: Disable selinux
|
|
|
|
- selinux:
|
|
|
|
- state: disabled
|
|
|
|
- tags: install
|
|
|
|
|
|
+ - name: Install common packages
|
|
|
|
+ package:
|
|
|
|
+ name: "{{ common_packages_for_non_leap }}"
|
|
|
|
+ state: present
|
|
|
|
+ tags: install
|
|
|
|
|
|
-- name: Install common packages
|
|
|
|
- package:
|
|
|
|
- name: "{{ common_packages }}"
|
|
|
|
- state: present
|
|
|
|
- tags: install
|
|
|
|
|
|
+ - name: Versionlock docker
|
|
|
|
+ command: "yum versionlock '{{ item }}'"
|
|
|
|
+ args:
|
|
|
|
+ warn: false
|
|
|
|
+ with_items:
|
|
|
|
+ - "{{ docker_packages }}"
|
|
|
|
+ changed_when: true
|
|
|
|
+ tags: install
|
|
|
|
|
|
-- name: Versionlock docker
|
|
|
|
- command: "yum versionlock '{{ item }}'"
|
|
|
|
- args:
|
|
|
|
- warn: false
|
|
|
|
- with_items:
|
|
|
|
- - "{{ docker_packages }}"
|
|
|
|
- changed_when: true
|
|
|
|
- tags: install
|
|
|
|
|
|
+ - name: Collect host facts (including acclerator information)
|
|
|
|
+ setup: ~
|
|
|
|
|
|
-- name: Collect host facts (including acclerator information)
|
|
|
|
- setup: ~
|
|
|
|
|
|
+ - name: Install infiniBand support
|
|
|
|
+ package:
|
|
|
|
+ name: "@Infiniband Support"
|
|
|
|
+ state: present
|
|
|
|
+ tags: install
|
|
|
|
+ when: ( os_supported_leap not in compute_os )
|
|
|
|
|
|
-- name: Install infiniBand support
|
|
|
|
- package:
|
|
|
|
- name: "@Infiniband Support"
|
|
|
|
- state: present
|
|
|
|
- tags: install
|
|
|
|
|
|
+- block:
|
|
|
|
+ - name: Installing python-xml
|
|
|
|
+ package:
|
|
|
|
+ name: python-xml
|
|
|
|
+ state: present
|
|
|
|
+ tags: install
|
|
|
|
+
|
|
|
|
+ - name: Add nvidia repo
|
|
|
|
+ zypper_repository:
|
|
|
|
+ name: NVIDIA
|
|
|
|
+ repo: "{{ nvidia_repo }}"
|
|
|
|
+ state: present
|
|
|
|
+ autorefresh: yes
|
|
|
|
+ tags: install
|
|
|
|
+
|
|
|
|
+ - name: Install nvidia
|
|
|
|
+ command: zypper --gpg-auto-import-keys install -l -y x11-video-nvidiaG06
|
|
|
|
+ changed_when: false
|
|
|
|
+ tags: install
|
|
|
|
+
|
|
|
|
+ - name: Add docker community edition repository
|
|
|
|
+ get_url:
|
|
|
|
+ url: "{{ docker_repo_url_leap }}"
|
|
|
|
+ dest: "{{ docker_repo_dest_leap }}"
|
|
|
|
+ register: docker_repo
|
|
|
|
+ until: docker_repo is not failed
|
|
|
|
+ retries: "{{ max_retries }}"
|
|
|
|
+ delay: "{{ max_delay }}"
|
|
|
|
+ tags: install
|
|
|
|
+
|
|
|
|
+ - name: Permanently Disable swap
|
|
|
|
+ mount:
|
|
|
|
+ name: "swap"
|
|
|
|
+ fstype: swap
|
|
|
|
+ state: absent
|
|
|
|
+ tags: install
|
|
|
|
+
|
|
|
|
+ - name: Install common packages
|
|
|
|
+ package:
|
|
|
|
+ name: "{{ common_packages }}"
|
|
|
|
+ state: present
|
|
|
|
+ tags: install
|
|
|
|
+
|
|
|
|
+ - name: Install docker-compose
|
|
|
|
+ package:
|
|
|
|
+ name: docker-compose
|
|
|
|
+ state: present
|
|
|
|
+ tags: install
|
|
|
|
+
|
|
|
|
+ - name: Collect host facts (including acclerator information)
|
|
|
|
+ setup: ~
|
|
|
|
+ tags: install
|
|
|
|
+
|
|
|
|
+ - name: Install infiniBand support
|
|
|
|
+ package:
|
|
|
|
+ name: infiniband-diags
|
|
|
|
+ state: present
|
|
|
|
+ tags: install
|
|
|
|
+ when: ( os_supported_leap in compute_os ) and ( ansible_distribution_version >= os_supported_leap_version )
|
|
|
|
|
|
- name: Deploy time ntp/chrony
|
|
- name: Deploy time ntp/chrony
|
|
include_tasks: ntp.yml
|
|
include_tasks: ntp.yml
|
|
@@ -106,15 +177,16 @@
|
|
include_tasks: nvidia.yml
|
|
include_tasks: nvidia.yml
|
|
when:
|
|
when:
|
|
- ansible_local.inventory.nvidia_gpu > 0
|
|
- ansible_local.inventory.nvidia_gpu > 0
|
|
- - ansible_facts['distribution'] == os_name
|
|
|
|
- - ansible_facts['distribution_major_version'] == os_version
|
|
|
|
|
|
+ - ( ansible_facts['distribution'] == os_name and ansible_facts['distribution_major_version'] == os_version) or
|
|
|
|
+ ( os_supported_leap in compute_os ) and ( ansible_distribution_version >= os_supported_leap_version )
|
|
tags: install
|
|
tags: install
|
|
|
|
|
|
- name: Install AMD GPU drivers and software components
|
|
- name: Install AMD GPU drivers and software components
|
|
include_tasks: amd.yml
|
|
include_tasks: amd.yml
|
|
when:
|
|
when:
|
|
- ansible_local.inventory.amd_gpu > 0
|
|
- ansible_local.inventory.amd_gpu > 0
|
|
- - ansible_facts['distribution'] == os_name
|
|
|
|
|
|
+ - ansible_facts['distribution'] == os_name or
|
|
|
|
+ ( os_supported_leap in compute_os ) and ( ansible_distribution_version >= os_supported_leap_version )
|
|
tags: install
|
|
tags: install
|
|
|
|
|
|
- name: Get the hostname
|
|
- name: Get the hostname
|
|
@@ -194,4 +266,4 @@
|
|
- "{{ groups['compute'] }}"
|
|
- "{{ groups['compute'] }}"
|
|
when:
|
|
when:
|
|
- hostvars["127.0.0.1"]["login_node_required"]
|
|
- hostvars["127.0.0.1"]["login_node_required"]
|
|
- - '"login_node" in group_names'
|
|
|
|
|
|
+ - '"login_node" in group_names'
|