]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
cobbler: testnode post-install rc.local fixes 252/head
authorDavid Galloway <dgallowa@redhat.com>
Wed, 22 Jun 2016 21:58:06 +0000 (17:58 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Wed, 22 Jun 2016 22:04:20 +0000 (18:04 -0400)
- Instead of sleeping for 30 secs and hoping network is up, wait until we can
reliably ping the Cobbler host.
- Give ansible more time to run before wget's built-in 15min timeout is reached.

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

index 17bee594e7afa2f1ab909bb4d28e6f435c86dfb5..63b6124910f2cd35b065995873a5ee147c206916 100644 (file)
@@ -21,10 +21,15 @@ if [ -e $lockfile ]; then
     exit 0
 fi
 
-# Wait just a bit for the network to come up
-sleep 30
+# Wait until we get 10 ping responses from Cobbler host
+# before calling post-install trigger
+until ping -nq -c10 $http_server
+do
+    echo "Waiting for network"
+    sleep 3
+done
 # Run the post-install trigger a second time
-wget -t1 -O /dev/null "http://$http_server:$http_port/cblr/svc/op/trig/mode/post/system/$system_name" || true
+wget --timeout=1800 -t1 -O /dev/null "http://$http_server:$http_port/cblr/svc/op/trig/mode/post/system/$system_name" || true
 touch $lockfile
 EOF