]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
cobbler: Allow ifdown to fail during rc.local 478/head
authorDavid Galloway <dgallowa@redhat.com>
Thu, 10 Oct 2019 17:20:36 +0000 (13:20 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Thu, 10 Oct 2019 17:20:36 +0000 (13:20 -0400)
Behavior changed in RHEL8.  See example below.

```
+ ifdown enp3s0f1
Error: '/etc/sysconfig/network-scripts/ifcfg-enp3s0f1' is not an active connection.
Error: no active connection provided.
```

Then the script would quit.

Signed-off-by: David Galloway <dgallowa@redhat.com>
roles/cobbler/templates/snippets/cephlab_rc_local

index 000e8d3599e4083e870c78656ba93357bf136624..895f570f6140144e77a70d451fb37b35ee18e3d9 100644 (file)
@@ -43,10 +43,10 @@ if [ ! -f /.cephlab_net_configured ]; then
       else
         echo -e "DEVICE=$nic\nBOOTPROTO=dhcp\nONBOOT=yes" > /etc/sysconfig/network-scripts/ifcfg-$nic
       fi
+      # Don't bail if NIC fails to go down or come up
+      set +e
       # Bounce the NIC so it gets a DHCP address
       ifdown $nic
-      # Don't bail if NIC fails to come up
-      set +e
       ifup $nic
       attempts=0
       # Try for 5 seconds to ping our Cobbler host