18658: address review comments.
authorJavier Bértoli <jbertoli@curii.com>
Fri, 21 Jan 2022 19:07:00 +0000 (16:07 -0300)
committerJavier Bértoli <jbertoli@curii.com>
Fri, 21 Jan 2022 19:53:26 +0000 (16:53 -0300)
Arvados-DCO-1.1-Signed-off-by: Javier Bértoli <jbertoli@curii.com>

tools/salt-install/local.params.example.multiple_hosts
tools/salt-install/local.params.example.single_host_multiple_hostnames
tools/salt-install/provision.sh

index eb64bb6227b28cc09b0953cce2dbc712f87187ea..c6f196ca9aca113ff751959ba55b10aa21f16ba2 100644 (file)
@@ -79,10 +79,12 @@ LE_AWS_SECRET_ACCESS_KEY="thisistherandomstringthatisyoursecretkey"
 # help you deploy them. In order to do that, you need to set `USE_LETSENCRYPT=no` above,
 # and copy the required certificates under the directory specified in the next line.
 # The certs will be copied from this directory by the provision script.
-# Plese set it to the FULL PATH to the certs dir if you're going to use a different dir
+# Please set it to the FULL PATH to the certs dir if you're going to use a different dir
+# Default is "${SCRIPT_DIR}/certs", where the variable "SCRIPT_DIR" has the path to the
+# directory where the  "provision.sh" script was copied in the destination host.
 # CUSTOM_CERTS_DIR="${SCRIPT_DIR}/certs"
 # The script expects cert/key files with these basenames (matching the role except for
-# keepweb, which is split in both downoad/collections):
+# keepweb, which is split in both download/collections):
 #  "controller"
 #  "websocket"
 #  "workbench"
@@ -90,10 +92,10 @@ LE_AWS_SECRET_ACCESS_KEY="thisistherandomstringthatisyoursecretkey"
 #  "webshell"
 #  "download"         # Part of keepweb
 #  "collections"      # Part of keepweb
-#  "keep"             # Keepproxy
+#  "keepproxy"        # Keepproxy
 # Ie., 'keep', the script will lookup for
-# ${CUSTOM_CERTS_DIR}/keep.crt
-# ${CUSTOM_CERTS_DIR}/keep.key
+# ${CUSTOM_CERTS_DIR}/keepproxy.crt
+# ${CUSTOM_CERTS_DIR}/keepproxy.key
 
 # The directory to check for the config files (pillars, states) you want to use.
 # There are a few examples under 'config_examples'.
index 6c9258a3c556c943797949616667da0f0f1869e4..11ebc119f7b21984452b5a68e12a4709553b131b 100644 (file)
@@ -52,10 +52,12 @@ USE_LETSENCRYPT="no"
 # help you deploy them. In order to do that, you need to set `USE_LETSENCRYPT=no` above,
 # and copy the required certificates under the directory specified in the next line.
 # The certs will be copied from this directory by the provision script.
-# Plese set it to the FULL PATH to the certs dir if you're going to use a different dir
+# Please set it to the FULL PATH to the certs dir if you're going to use a different dir
+# Default is "${SCRIPT_DIR}/certs", where the variable "SCRIPT_DIR" has the path to the
+# directory where the  "provision.sh" script was copied in the destination host.
 # CUSTOM_CERTS_DIR="${SCRIPT_DIR}/certs"
 # The script expects cert/key files with these basenames (matching the role except for
-# keepweb, which is split in both downoad/collections):
+# keepweb, which is split in both download/collections):
 #  "controller"
 #  "websocket"
 #  "workbench"
index 6f1e625c9b6b52ad1e838c7e4a29410576dd9e1f..83a538ee59bb8337e8ac33e4ad8823733b591f3e 100755 (executable)
@@ -141,8 +141,19 @@ copy_custom_cert() {
   cert_name=${2}
 
   mkdir -p /srv/salt/certs
-  cp -v ${cert_dir}/${cert_name}.crt /srv/salt/certs/arvados-${cert_name}.pem
-  cp -v ${cert_dir}/${cert_name}.key /srv/salt/certs/arvados-${cert_name}.key
+
+  if [ -f ${cert_dir}/${cert_name}.crt ]; then
+    cp -v ${cert_dir}/${cert_name}.crt /srv/salt/certs/arvados-${cert_name}.pem
+  else
+    echo "${cert_dir}/${cert_name}.crt does not exist. Exiting"
+    exit 1
+  fi
+  if [ -f ${cert_dir}/${cert_name}.key ]; then
+    cp -v ${cert_dir}/${cert_name}.key /srv/salt/certs/arvados-${cert_name}.key
+  else
+    echo "${cert_dir}/${cert_name}.key does not exist. Exiting"
+    exit 1
+  fi
 }
 
 DEV_MODE="no"