]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
Removing arch variable to use variable directly from the inventory
authorFernando <fernando.alcocer.ochoa@ibm.com>
Fri, 16 May 2025 00:19:01 +0000 (18:19 -0600)
committerFernando <fernando.alcocer.ochoa@ibm.com>
Fri, 16 May 2025 00:19:01 +0000 (18:19 -0600)
Signed-off-by: Fernando <fernando.alcocer.ochoa@ibm.com>
roles/maas/tasks/add_machines.yml

index 3b2bc60eb78da81ebcddf3e988b57a03ae38ecd7..7fc1bfb4521fd93b30d782e2a59441e1ee8516bc 100644 (file)
@@ -1,7 +1,5 @@
 ---
 - name: Add all machines from inventory to MAAS
-  vars:  
-    arch: "amd64"  # Change if needed
   when: inventory_hostname in groups['maas_region_rack_server']
   tags: add_machines
   block:
@@ -17,7 +15,8 @@
       vars:
         hostname: "{{ item.split('.')[0] }}"
         mac_address: "{{ hostvars[item]['mac'] }}"
-      when: hostname not in existing_hostnames and mac_address is defined
+        arch: "{{ hostvars[item]['arch'] }}"
+      when: hostname not in existing_hostnames and mac_address is defined and arch is defined
       loop: "{{ groups['testnodes'] }}"
       command: "maas {{ maas_admin_username }} machines create architecture={{ arch }} mac_addresses={{ mac_address }} hostname={{ item }} power_type=manual deployed=true"