]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
generate-fog-csv: Ignore missing mac hostvar wip-ignore-mac
authorDavid Galloway <dgallowa@redhat.com>
Wed, 11 Mar 2020 19:17:28 +0000 (15:17 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Wed, 11 Mar 2020 19:18:06 +0000 (15:18 -0400)
If this is missing in the CSV, FOG will still let you import the host; the MAC field is just blank.  This is fine because we're just using the `[cobbler_managed]` inventory group to define hosts that FOG should manage.  However, some systems (like the refarch switches) are in the `[refarch]` group but don't have MAC addresses.  On top of that, we're not using FOG to reimage the refarch machines so it doesn't matter if the MAC is missing in FOG.

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

index 67947b5a50cd94102aff594ade8ad69b2162fa95..e0ba8140eabf00dbaa39be7763b58e5270559ed9 100644 (file)
@@ -1,3 +1,3 @@
 {% for host in groups['cobbler_managed'] %}
-"{{ 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","","",""
+"{% if hostvars[host]['mac'] is defined %}{{ hostvars[host]['mac'] }}{% endif %}","{{ 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","","",""
 {% endfor %}