Pārlūkot izejas kodu

Merge branch 'devel' into patch-1

Shubhangi-dell 3 gadi atpakaļ
vecāks
revīzija
4f22688c09

+ 9 - 0
.all-contributorsrc

@@ -288,6 +288,15 @@
         "test",
         "code"
       ]
+    },
+    {
+      "login": "ptrinesh",
+      "name": "ptrinesh",
+      "avatar_url": "https://avatars.githubusercontent.com/u/73214211?v=4",
+      "profile": "https://github.com/ptrinesh",
+      "contributions": [
+        "code"
+      ]
     }
   ],
   "contributorsPerLine": 7,

+ 3 - 0
README.md

@@ -65,6 +65,9 @@ Thanks goes to everyone who makes Omnia possible ([emoji key](https://allcontrib
     <td align="center"><a href="https://github.com/Bhagyashree-shetty"><img src="https://avatars.githubusercontent.com/u/90620926?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Bhagyashree-shetty</b></sub></a><br /><a href="https://github.com/dellhpc/omnia/commits?author=Bhagyashree-shetty" title="Tests">⚠️</a> <a href="https://github.com/dellhpc/omnia/commits?author=Bhagyashree-shetty" title="Code">💻</a></td>
     <td align="center"><a href="https://github.com/nihalranjan-hpc"><img src="https://avatars.githubusercontent.com/u/84398828?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Nihal Ranjan</b></sub></a><br /><a href="https://github.com/dellhpc/omnia/commits?author=nihalranjan-hpc" title="Tests">⚠️</a> <a href="https://github.com/dellhpc/omnia/commits?author=nihalranjan-hpc" title="Code">💻</a></td>
   </tr>
+  <tr>
+    <td align="center"><a href="https://github.com/ptrinesh"><img src="https://avatars.githubusercontent.com/u/73214211?v=4?s=100" width="100px;" alt=""/><br /><sub><b>ptrinesh</b></sub></a><br /><a href="https://github.com/dellhpc/omnia/commits?author=ptrinesh" title="Code">💻</a></td>
+  </tr>
 </table>
 
 <!-- markdownlint-restore -->

+ 16 - 2
control_plane/roles/deploy_job_templates/tasks/group_inventory.yml

@@ -20,13 +20,27 @@
   no_log: true
   register: hosts_list
 
-- name: Add the host to the group in node_inventory if present
+- name: Add the host to compute group in node_inventory if it exists
   awx.awx.tower_group:
     name: "{{ item.split(',')[3] }}"
     inventory: "{{ node_inventory }}"
+    preserve_existing_hosts: true
     hosts:
       - "{{ item.split(',')[2] }}"
     tower_config_file: "{{ tower_config_file }}"
   when:
     - item.split(',')[2] != "IP"
-    - item.split(',')[2] in hosts_list.stdout
+    - item.split(',')[2] in hosts_list.stdout 
+    - item.split(',')[3] == "compute"
+
+- name: Add the host to other groups in node_inventory if it exists
+  awx.awx.tower_group:
+    name: "{{ item.split(',')[3] }}"
+    inventory: "{{ node_inventory }}"
+    hosts:
+      - "{{ item.split(',')[2] }}"
+    tower_config_file: "{{ tower_config_file }}"
+  when:
+    - item.split(',')[2] != "IP"
+    - item.split(',')[2] in hosts_list.stdout
+    - item.split(',')[3] != "compute"