Add ssl support for masakari plugin

To enable ssl support for masakari using devstack just
mention 'ENABLED_SERVICES+=,tls-proxy' in local.conf
file.

Change-Id: Ia65d20083c8740d7dbbc38600ffd7de06cf08010
This commit is contained in:
Abhishek Kekane 2017-09-29 10:43:26 +05:30
parent 3e51c4cf54
commit 26f00f4ad7
2 changed files with 19 additions and 3 deletions

View File

@ -21,6 +21,10 @@
XTRACE=$(set +o | grep xtrace)
set +o xtrace
if is_service_enabled tls-proxy; then
MASAKARI_SERVICE_PROTOCOL="https"
fi
# Functions
# ---------
@ -50,9 +54,9 @@ function create_masakari_accounts {
"ha" "OpenStack High Availability")
get_or_create_endpoint $masakari_service \
"$REGION_NAME" \
"http://$SERVICE_HOST:$MASAKARI_SERVICE_PORT/v1/\$(tenant_id)s" \
"http://$SERVICE_HOST:$MASAKARI_SERVICE_PORT/v1/\$(tenant_id)s" \
"http://$SERVICE_HOST:$MASAKARI_SERVICE_PORT/v1/\$(tenant_id)s"
"$MASAKARI_SERVICE_PROTOCOL://$SERVICE_HOST:$MASAKARI_SERVICE_PORT/v1/\$(tenant_id)s" \
"$MASAKARI_SERVICE_PROTOCOL://$SERVICE_HOST:$MASAKARI_SERVICE_PORT/v1/\$(tenant_id)s" \
"$MASAKARI_SERVICE_PROTOCOL://$SERVICE_HOST:$MASAKARI_SERVICE_PORT/v1/\$(tenant_id)s"
fi
}
@ -117,6 +121,10 @@ function configure_masakari {
iniset $MASAKARI_CONF DEFAULT os_privileged_user_password "$SERVICE_PASSWORD"
iniset $MASAKARI_CONF DEFAULT os_privileged_user_tenant "$SERVICE_PROJECT_NAME"
iniset $MASAKARI_CONF DEFAULT graceful_shutdown_timeout "$SERVICE_GRACEFUL_SHUTDOWN_TIMEOUT"
if is_service_enabled tls-proxy; then
iniset $MASAKARI_CONF DEFAULT masakari_api_listen_port $MASAKARI_SERVICE_PORT_INT
fi
}
# install_masakari() - Collect source and prepare
@ -149,6 +157,11 @@ function init_masakari {
# start_masakari() - Start running processes, including screen
function start_masakari {
if is_service_enabled tls-proxy; then
start_tls_proxy masakari-service '*' $MASAKARI_SERVICE_PORT $SERVICE_HOST $MASAKARI_SERVICE_PORT_INT
fi
run_process masakari-api "$MASAKARI_BIN_DIR/masakari-api --config-file=$MASAKARI_CONF --debug"
run_process masakari-engine "$MASAKARI_BIN_DIR/masakari-engine --config-file=$MASAKARI_CONF --debug"
}

View File

@ -17,6 +17,8 @@ MASAKARI_LOCAL_API_PASTE_INI=${MASAKARI_LOCAL_API_PASTE_INI:-${MASAKARI_LOCAL_CO
MASAKARI_LOCAL_POLICY_JSON=${MASAKARI_LOCAL_POLICY_JSON:-${MASAKARI_LOCAL_CONF_DIR}/policy.json}
MASAKARI_AUTH_CACHE_DIR=${MASAKARI_AUTH_CACHE_DIR:-/var/cache/masakari}
MASAKARI_SERVICE_PROTOCOL=${MASAKARI_SERVICE_PROTOCOL:-http}
# Support entry points installation of console scripts
if [[ -d $MASAKARI_DIR/bin ]]; then
MASAKARI_BIN_DIR=$MASAKARI_DIR/bin
@ -27,6 +29,7 @@ MASAKARI_MANAGE=$MASAKARI_BIN_DIR/masakari-manage
# Public facing bits
MASAKARI_SERVICE_PORT=${MASAKARI_SERVICE_PORT:-15868}
MASAKARI_SERVICE_PORT_INT=${MASAKARI_SERVICE_PORT_INT:-25868}
# Tell Tempest this project is present
TEMPEST_SERVICES+=,masakari