]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
generate-fog-csv: Only print a line if the MAC is defined 577/head
authorDavid Galloway <dgallowa@redhat.com>
Thu, 11 Jun 2020 19:14:53 +0000 (15:14 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Thu, 11 Jun 2020 19:14:53 +0000 (15:14 -0400)
There's some hosts that are "cobbler_managed" but don't have a MAC and don't need a MAC.  Ansible doesn't help us out any here and print WHICH host doesn't have a MAC.  Just throws an error.

Also, there's no need to gather facts on localhost so I set that to `false`

Signed-off-by: David Galloway <dgallowa@redhat.com>
tools/generate-fog-csv.yml
tools/roles/generate-fog-csv/templates/csv.j2

index c8594483b739ecffafdd94d302f3f04ffbb03412..d8662616a8b8fb5219aea2e632c41f23ac5113ce 100644 (file)
@@ -7,3 +7,4 @@
   roles:
     - generate-fog-csv
   become: false
+  gather_facts: false
index 67947b5a50cd94102aff594ade8ad69b2162fa95..61ee4f4e37b980e830eab02463cbdc066b49ecad 100644 (file)
@@ -1,3 +1,5 @@
 {% for host in groups['cobbler_managed'] %}
+{% if hostvars[host]['mac'] is defined %}
 "{{ hostvars[host]['mac'] }}","{{ hostvars[host]['inventory_hostname_short'] }}","","","1","0","","","fog","","","","","","","","","{{ hostvars[host]['kernel_options'] }}","","{{ hostvars[host]['fog_install_drive']|default('/dev/sda') }}","","","","","0000-00-00 00:00:00","110","","",""
+{% endif %}
 {% endfor %}