]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
cobbler_systems: Only populate systems that have necessary vars defined 462/head
authorDavid Galloway <dgallowa@redhat.com>
Thu, 18 Jul 2019 16:32:01 +0000 (12:32 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Thu, 18 Jul 2019 16:32:01 +0000 (12:32 -0400)
Signed-off-by: David Galloway <dgallowa@redhat.com>
roles/cobbler_systems/tasks/populate_systems.yml

index 4c6409003ec8bee3d76c833db68083ff1ed8b89f..2b36c503682d3f6bee6f56691e4b68ae2b8fe224 100644 (file)
@@ -16,6 +16,9 @@
 - name: Add missing systems to cobbler
   command: cobbler system add --name={{ item.split('.')[0] }} --profile={{ default_profile }} --mac={{ hostvars[item].mac }} --ip-address={{ hostvars[item].ip }} --interface={{ hostvars[item].interface|default(interface) }} --hostname={{ item.split('.')[0] }}.{{ lab_domain }} --kopts="{{ hostvars[item].kernel_options|default(kernel_options) }}" --ksmeta="{{ hostvars[item].kickstart_metadata|default(kickstart_metadata) }}" --power-type={{ hostvars[item].power_type|default(power_type) }} --power-address={{ item.split('.')[0] }}.{{ ipmi_domain }} --power-user={{ hostvars[item].power_user|default(power_user) }} --power-pass={{ hostvars[item].power_pass|default(power_pass) }} --netboot-enabled false
   with_items: "{{ cobbler_systems_add }}"
+  when:
+    - hostvars[item].mac is defined
+    - hostvars[item].ip is defined
 
 - name: set cobbler_systems_update
   set_fact: