Browse Source

Merge pull request #667 from blesson-james/nvidia

Issue #666: Added checks for CentOS in nvidia & amd tasks
Sujit Jadhav 3 years ago
parent
commit
44fe20dfa6
2 changed files with 9 additions and 3 deletions
  1. 8 3
      roles/common/tasks/main.yml
  2. 1 0
      roles/common/vars/main.yml

+ 8 - 3
roles/common/tasks/main.yml

@@ -104,12 +104,17 @@
 
 - name: Install Nvidia drivers and software components
   include_tasks: nvidia.yml
-  when: ansible_local.inventory.nvidia_gpu > 0
+  when:
+    - ansible_local.inventory.nvidia_gpu > 0
+    - ansible_facts['distribution'] == os_name
+    - ansible_facts['distribution_major_version'] == os_version
   tags: install
 
 - name: Install AMD GPU drivers and software components
   include_tasks: amd.yml
-  when: ansible_local.inventory.amd_gpu > 0
+  when:
+    - ansible_local.inventory.amd_gpu > 0
+    - ansible_facts['distribution'] == os_name
   tags: install
 
 - name: Get the hostname
@@ -189,4 +194,4 @@
     - "{{ groups['compute'] }}"
   when:
     - hostvars["127.0.0.1"]["login_node_required"]
-    - '"login_node" in group_names'
+    - '"login_node" in group_names'

+ 1 - 0
roles/common/vars/main.yml

@@ -52,6 +52,7 @@ ntp_path: "/etc/ntp.conf"
 ntp_mode: "0644"
 os_higher_version: "8"
 os_version: "7"
+os_name: "CentOS"
 retry_count_one: "10"
 delay_count_one: "60"
 retry_count: "6"