forked from ISTI-ansible-roles/ansible-roles
44 lines
1.7 KiB
Django/Jinja
44 lines
1.7 KiB
Django/Jinja
#!/bin/bash
|
|
|
|
SM_DIR={{ smartgears_install_path }}
|
|
SM_LIB_DIR=${SM_DIR}/lib
|
|
# The dataminer wants the gcube keys in a different directory too
|
|
SM_DATAMINER_PARALLEL_PROC={{ smartgears_user_home }}/tomcat/webapps/wps/ecocfg/PARALLEL_PROCESSING
|
|
LOG_FILE=/var/log/smartgears-gcubekeys-setup.log
|
|
|
|
INFRA_NAME=$1
|
|
> $LOG_FILE
|
|
|
|
if [ ! -d $SM_LIB_DIR ] ; then
|
|
echo "$0: The lib directory: $SM_LIB_DIR does not exist, aborting" >> $LOG_FILE
|
|
exit 1
|
|
else
|
|
pushd $SM_LIB_DIR >/dev/null 2>&1
|
|
fi
|
|
|
|
if [ "$INFRA_NAME" == "gcube" ] ; then
|
|
wget {{ gcube_dkey_1 }} --no-check-certificate -o /dev/null -O gcube.gcubekey
|
|
wget {{ gcube_dkey_2 }} --no-check-certificate -o /dev/null -O devsec.gcubekey
|
|
wget {{ gcube_dkey_3 }} --no-check-certificate -o /dev/null -O devNext.gcubekey
|
|
elif [ "$INFRA_NAME" == "d4science.research-infrastructures.eu" ] ; then
|
|
wget {{ gcube_pkey_1 }} --no-check-certificate -o /dev/null -O d4science.research-infrastructures.eu.gcubekey
|
|
wget {{ gcube_pkey_2 }} --no-check-certificate -o /dev/null -O FARM.gcubekey
|
|
wget {{ gcube_pkey_3 }} --no-check-certificate -o /dev/null -O gCubeApps.gcubekey
|
|
chmod 400 $SM_LIB_DIR/*.gcubekey
|
|
else
|
|
echo "The Infra name is unknown, no keys downloaded" >> $LOG_FILE
|
|
exit 0
|
|
fi
|
|
popd >/dev/null 2>&1
|
|
chmod 400 $SM_LIB_DIR/*.gcubekey >> $LOG_FILE 2>&1
|
|
chown gcube:root $SM_LIB_DIR/*.gcubekey >> $LOG_FILE 2>&1
|
|
if [ -d $SM_DATAMINER_PARALLEL_PROC ] ; then
|
|
echo "This is a dataminer. Copy the keys inside the dataminer conf dir" >> $LOG_FILE 2>&1
|
|
cp -a $SM_LIB_DIR/*.gcubekey $SM_DATAMINER_PARALLEL_PROC >> $LOG_FILE 2>&1
|
|
chmod 400 $SM_DATAMINER_PARALLEL_PROC/*.gcubekey >> $LOG_FILE 2>&1
|
|
chown gcube:root $SM_DATAMINER_PARALLEL_PROC/*.gcubekey >> $LOG_FILE 2>&1
|
|
fi
|
|
|
|
exit 0
|
|
|