18785: add explicit test that IP_INT is set correctly in the single host
[arvados.git] / tools / salt-install / provision.sh
index 8bca9d0bd536309ac3dbe021044ad03c4aab935e..f467c77e78f3545b66314f758abdf3c193ac33e4 100755 (executable)
@@ -257,6 +257,14 @@ fi
 if [ ! -z "${HOSTNAME_EXT}" ] ; then
   # We need to add some extra control vars to manage a single certificate vs. multiple
   USE_SINGLE_HOSTNAME="yes"
+  # Make sure that the value configured as IP_INT is a real IP on the system.
+  # If we don't error out early here when there is a mismatch, the formula will
+  # fail with hard to interpret nginx errors later on.
+  ip addr list |grep -q " ${IP_INT}/"
+  if [[ $? -ne 0 ]]; then
+    echo "Unable to find the IP_INT address '${IP_INT}' on the system, please correct the value in local.params. Exiting..."
+    exit 1
+  fi
 else
   USE_SINGLE_HOSTNAME="no"
   # We set this variable, anyway, so sed lines do not fail and we don't need to add more