diff --git a/elements/os-net-config/os-refresh-config/configure.d/20-os-net-config b/elements/os-net-config/os-refresh-config/configure.d/20-os-net-config index e94dd3d80..92879146c 100755 --- a/elements/os-net-config/os-refresh-config/configure.d/20-os-net-config +++ b/elements/os-net-config/os-refresh-config/configure.d/20-os-net-config @@ -27,6 +27,7 @@ function is_local_ip() { function ping_metadata_ip() { local METADATA_IP=$(get_metadata_ip) + local METADATA_IP_PING_TIMEOUT=60 if [ -n "$METADATA_IP" ] && ! is_local_ip $METADATA_IP; then @@ -35,7 +36,8 @@ function ping_metadata_ip() { local COUNT=0 until ping -c 1 $METADATA_IP &> /dev/null; do COUNT=$(( $COUNT + 1 )) - if [ $COUNT -eq 10 ]; then + sleep 1 + if [ $COUNT -eq $METADATA_IP_PING_TIMEOUT ]; then echo "FAILURE" echo "$METADATA_IP is not pingable." >&2 exit 1