New container variable: SURVEIL_KEYSTONE_ENDPOINT
Change-Id: I6120ccf2acd915f5cf1c4555c348f1ac101d79e1
This commit is contained in:
parent
6fc066cf2a
commit
11cbf5c40c
@ -33,8 +33,9 @@ ENV PBR_VERSION=PROD
|
||||
# We are using develop so that the code can be mounted when in DEV.
|
||||
RUN cd /opt/surveil && python setup.py develop
|
||||
|
||||
#Set to 'surveil-auth' for surveil-specific auth or set to 'authtoken' for Keystone authentication
|
||||
ENV SURVEIL_AUTH_BACKEND=surveil-auth
|
||||
#Set to 'surveil' or 'keystone'
|
||||
ENV SURVEIL_AUTH_BACKEND=surveil
|
||||
ENV SURVEIL_KEYSTONE_ENDPOINT=127.0.0.1
|
||||
|
||||
CMD cd /opt/surveil && \
|
||||
./setup.sh && \
|
||||
|
@ -1,13 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
function setup_surveil_api {
|
||||
sed -i "s/pipeline =.*/pipeline = ${SURVEIL_AUTH_BACKEND} api-server/" /etc/surveil/api_paste.ini
|
||||
if [ $SURVEIL_AUTH_BACKEND = surveil ] ; then
|
||||
echo -e "=> Setting up Surveil API for surveil authentication..."
|
||||
sed -i "s/pipeline =.*/pipeline = surveil-auth api-server/" /etc/surveil/api_paste.ini
|
||||
else
|
||||
echo -e "=> Setting up Surveil API for keystone authentication..."
|
||||
sed -i "s/pipeline =.*/pipeline = auth-token api-server/" /etc/surveil/api_paste.ini
|
||||
sed -i "s/auth_host=.*/auth_host=${SURVEIL_KEYSTONE_ENDPOINT}/" /etc/surveil/api_paste.ini
|
||||
fi
|
||||
}
|
||||
|
||||
if [ -f "/.surveil_api_setup" ]; then
|
||||
echo "=> Surveil API was already configured, skipping..."
|
||||
else
|
||||
echo -e "=> Configuring Surveil API..."
|
||||
setup_surveil_api && touch "/.surveil_api_setup"
|
||||
echo -e "=> Done with API configuration."
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user