library/roles/smartgears/ckan_connector: Remove the old war file. Fix the ckan-connector-fixer script.

This commit is contained in:
Andrea Dell'Amico 2016-07-21 13:04:32 +02:00
parent d6e985159e
commit 38e69bec93
2 changed files with 12 additions and 2 deletions

View File

@ -22,6 +22,7 @@ paster sysadmin add $CK_ADMIN -c $CK_INI << EOF
y
$CK_ADMIN_PWD
$CK_ADMIN_PWD
EOF
# Get the admin key
@ -36,10 +37,19 @@ CKAN_KEY=$( grep ^beaker\.session\.secret $CK_INI | awk '{ print $3 }' )
[ $? -ne 0 ] && exit 1
# Use the admin key on the connector web.xml
[ ! -z $API_KEY ] && sed -i -e "s#@CKAN_API_KEY@#${API_KEY}#g" $CK_WEB_XML
if [ ! -z $API_KEY ] ; then
sed -i -e "s#@CKAN_API_KEY@#${API_KEY}#g" $CK_WEB_XML
else
exit 1
fi
# Use the ckan key on the connector web.xml
[ ! -z $CKAN_KEY ] && sed -i -e "s#@CKAN_SECRET@#${CKAN_KEY}#g" $CK_WEB_XML
if [ ! -z $CKAN_KEY ] ; then
sed -i -e "s#@CKAN_SECRET@#${CKAN_KEY}#g" $CK_WEB_XML
else
exit 1
fi
chown {{ smartgears_user }}:{{ smartgears_user }} $CK_WEB_XML
chmod 440 $CK_WEB_XML