Merge branch '18631-shell-login-sync'
authorJavier Bértoli <jbertoli@curii.com>
Wed, 6 Apr 2022 13:50:51 +0000 (10:50 -0300)
committerJavier Bértoli <jbertoli@curii.com>
Wed, 6 Apr 2022 13:50:51 +0000 (10:50 -0300)
closes #18631
Arvados-DCO-1.1-Signed-off-by: Javier Bértoli <jbertoli@curii.com>

1  2 
tools/salt-install/provision.sh

index a26b3feaa3e0536266e9a4d73ed85c9196fbd792,5f6c389b767f2bb9e99d42987519d79226e7e21a..f6e3bb3ae02f445fde34c50cad27d5eee6975e71
@@@ -417,34 -417,30 +417,34 @@@ for f in $(ls "${SOURCE_PILLARS_DIR}"/*
    "${f}" > "${P_DIR}"/$(basename "${f}")
  done
  
 -if [ "x${TEST}" = "xyes" ] && [ ! -d "${SOURCE_TESTS_DIR}" ]; then
 -  echo "You requested to run tests, but ${SOURCE_TESTS_DIR} does not exist or is not a directory. Exiting."
 -  exit 1
 -fi
 -mkdir -p ${T_DIR}
 -# Replace cluster and domain name in the test files
 -for f in $(ls "${SOURCE_TESTS_DIR}"/*); do
 -  FILTERS="s#__CLUSTER__#${CLUSTER}#g;
 -       s#__CONTROLLER_EXT_SSL_PORT__#${CONTROLLER_EXT_SSL_PORT}#g;
 -       s#__DOMAIN__#${DOMAIN}#g;
 -       s#__IP_INT__#${IP_INT}#g;
 -       s#__INITIAL_USER_EMAIL__#${INITIAL_USER_EMAIL}#g;
 -       s#__INITIAL_USER_PASSWORD__#${INITIAL_USER_PASSWORD}#g
 -       s#__INITIAL_USER__#${INITIAL_USER}#g;
 -       s#__DATABASE_PASSWORD__#${DATABASE_PASSWORD}#g;
 -       s#__SYSTEM_ROOT_TOKEN__#${SYSTEM_ROOT_TOKEN}#g"
 -  if [ "$USE_SINGLE_HOSTNAME" = "yes" ]; then
 -    FILTERS="s#__CLUSTER__.__DOMAIN__#${HOSTNAME_EXT}#g;
 -       $FILTERS"
 +if [ ! -d "${SOURCE_TESTS_DIR}" ]; then
 +  echo "WARNING: The tests directory was not copied to \"${SOURCE_TESTS_DIR}\"."
 +  if [ "x${TEST}" = "xyes" ]; then
 +    echo "WARNING: Disabling tests for this installation."
    fi
 -  sed "$FILTERS" \
 -    "${f}" > ${T_DIR}/$(basename "${f}")
 -done
 -chmod 755 ${T_DIR}/run-test.sh
 +  TEST="no"
 +else
 +  mkdir -p ${T_DIR}
 +  # Replace cluster and domain name in the test files
 +  for f in $(ls "${SOURCE_TESTS_DIR}"/*); do
 +    FILTERS="s#__CLUSTER__#${CLUSTER}#g;
 +         s#__CONTROLLER_EXT_SSL_PORT__#${CONTROLLER_EXT_SSL_PORT}#g;
 +         s#__DOMAIN__#${DOMAIN}#g;
 +         s#__IP_INT__#${IP_INT}#g;
 +         s#__INITIAL_USER_EMAIL__#${INITIAL_USER_EMAIL}#g;
 +         s#__INITIAL_USER_PASSWORD__#${INITIAL_USER_PASSWORD}#g
 +         s#__INITIAL_USER__#${INITIAL_USER}#g;
 +         s#__DATABASE_PASSWORD__#${DATABASE_PASSWORD}#g;
 +         s#__SYSTEM_ROOT_TOKEN__#${SYSTEM_ROOT_TOKEN}#g"
 +    if [ "$USE_SINGLE_HOSTNAME" = "yes" ]; then
 +      FILTERS="s#__CLUSTER__.__DOMAIN__#${HOSTNAME_EXT}#g;
 +         $FILTERS"
 +    fi
 +    sed "$FILTERS" \
 +      "${f}" > ${T_DIR}/$(basename "${f}")
 +  done
 +  chmod 755 ${T_DIR}/run-test.sh
 +fi
  
  # Replace helper state files that differ from the formula's examples
  if [ -d "${SOURCE_STATES_DIR}" ]; then
@@@ -518,7 -514,7 +518,7 @@@ if [ -d "${F_DIR}"/extra/extra ]; the
      # Same when using self-signed certificates.
      SKIP_SNAKE_OIL="dont_add_snakeoil_certs"
    fi
-   for f in $(ls "${F_DIR}"/extra/extra/*.sls | egrep -v "${SKIP_SNAKE_OIL}|shell_sudo_passwordless"); do
+   for f in $(ls "${F_DIR}"/extra/extra/*.sls | egrep -v "${SKIP_SNAKE_OIL}|shell_"); do
    echo "    - extra.$(basename ${f} | sed 's/.sls$//g')" >> ${S_DIR}/top.sls
    done
    # Use byo or self-signed certificates
@@@ -548,10 -544,11 +548,11 @@@ if [ -z "${ROLES}" ]; the
      grep -q "custom_certs"    ${S_DIR}/top.sls || echo "    - extra.custom_certs" >> ${S_DIR}/top.sls
    fi
  
-   echo "    - extra.shell_sudo_passwordless" >> ${S_DIR}/top.sls
    echo "    - postgres" >> ${S_DIR}/top.sls
    echo "    - docker.software" >> ${S_DIR}/top.sls
    echo "    - arvados" >> ${S_DIR}/top.sls
+   echo "    - extra.shell_sudo_passwordless" >> ${S_DIR}/top.sls
+   echo "    - extra.shell_cron_add_login_sync" >> ${S_DIR}/top.sls
  
    # Pillars
    echo "    - docker" >> ${P_DIR}/top.sls
@@@ -759,6 -756,7 +760,7 @@@ els
        "shell")
          # States
          echo "    - extra.shell_sudo_passwordless" >> ${S_DIR}/top.sls
+         echo "    - extra.shell_cron_add_login_sync" >> ${S_DIR}/top.sls
          grep -q "docker" ${S_DIR}/top.sls       || echo "    - docker.software" >> ${S_DIR}/top.sls
          grep -q "arvados.${R}" ${S_DIR}/top.sls || echo "    - arvados.${R}" >> ${S_DIR}/top.sls
          # Pillars