From c6828e33550765d0e5ccb6f332e2432a9ac6c3ad Mon Sep 17 00:00:00 2001 From: David Galloway Date: Wed, 5 Sep 2018 14:09:31 -0400 Subject: [PATCH] cobbler: break at the appropriate location in rc.local Before this change, if the first NIC on a machine had a link but wasn't the uplinked NIC, the break would still get called and no NICs would be left up. Now we'll break only after we can ping the Cobbler host. Signed-off-by: David Galloway --- roles/cobbler/templates/snippets/cephlab_rc_local | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/roles/cobbler/templates/snippets/cephlab_rc_local b/roles/cobbler/templates/snippets/cephlab_rc_local index b5b5b97a..3f92e7b0 100644 --- a/roles/cobbler/templates/snippets/cephlab_rc_local +++ b/roles/cobbler/templates/snippets/cephlab_rc_local @@ -51,13 +51,15 @@ if [ ! -f /.cephlab_net_configured ]; then ifdown $nic rm -f /etc/sysconfig/network-scripts/ifcfg-$nic sed -i "/$nic/d" /etc/network/interfaces + # Go back to bailing if anything fails bringing the next NIC up + set -e + else + # We found our routable NIC! + # Write our lockfile so this only gets run on firstboot + touch /.cephlab_net_configured + # Break out of the loop once we've found our routable NIC + break fi - # Go back to bailing if anything fails bringing the next NIC up - set -e - # Write our lockfile so this only gets run on firstboot - touch /.cephlab_net_configured - # Break out of the loop once we've found our routable NIC - break else # Take the NIC back down if it's not connected ifconfig $nic down -- 2.47.3