|
|
@ -5,7 +5,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
# To enable, add the following to localrc
|
|
|
|
# To enable, add the following to localrc
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# ENABLED_SERVICES+=,heat,h-api,h-api-cfn,h-api-cw,h-eng
|
|
|
|
# ENABLED_SERVICES+=,heat,h-api,h-api-cfn,h-eng
|
|
|
|
|
|
|
|
|
|
|
|
# Dependencies:
|
|
|
|
# Dependencies:
|
|
|
|
# (none)
|
|
|
|
# (none)
|
|
|
@ -63,10 +63,8 @@ HEAT_TRUSTEE_DOMAIN=${HEAT_TRUSTEE_DOMAIN:-default}
|
|
|
|
HEAT_BIN_DIR=$(get_python_exec_prefix)
|
|
|
|
HEAT_BIN_DIR=$(get_python_exec_prefix)
|
|
|
|
HEAT_API_UWSGI_CONF=$HEAT_CONF_DIR/heat-api-uwsgi.ini
|
|
|
|
HEAT_API_UWSGI_CONF=$HEAT_CONF_DIR/heat-api-uwsgi.ini
|
|
|
|
HEAT_CFN_API_UWSGI_CONF=$HEAT_CONF_DIR/heat-api-cfn-uwsgi.ini
|
|
|
|
HEAT_CFN_API_UWSGI_CONF=$HEAT_CONF_DIR/heat-api-cfn-uwsgi.ini
|
|
|
|
HEAT_CW_API_UWSGI_CONF=$HEAT_CONF_DIR/heat-api-cloudwatch-uwsgi.ini
|
|
|
|
|
|
|
|
HEAT_API_UWSGI=$HEAT_BIN_DIR/heat-wsgi-api
|
|
|
|
HEAT_API_UWSGI=$HEAT_BIN_DIR/heat-wsgi-api
|
|
|
|
HEAT_CFN_API_UWSGI=$HEAT_BIN_DIR/heat-wsgi-api-cfn
|
|
|
|
HEAT_CFN_API_UWSGI=$HEAT_BIN_DIR/heat-wsgi-api-cfn
|
|
|
|
HEAT_CW_API_UWSGI=$HEAT_BIN_DIR/heat-wsgi-api-cloudwatch
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# other default options
|
|
|
|
# other default options
|
|
|
|
if [[ "$HEAT_STANDALONE" == "True" ]]; then
|
|
|
|
if [[ "$HEAT_STANDALONE" == "True" ]]; then
|
|
|
@ -119,8 +117,6 @@ function configure_heat {
|
|
|
|
HEAT_API_CFN_PORT=${HEAT_API_CFN_PORT:-8000}
|
|
|
|
HEAT_API_CFN_PORT=${HEAT_API_CFN_PORT:-8000}
|
|
|
|
HEAT_ENGINE_HOST=${HEAT_ENGINE_HOST:-$SERVICE_HOST}
|
|
|
|
HEAT_ENGINE_HOST=${HEAT_ENGINE_HOST:-$SERVICE_HOST}
|
|
|
|
HEAT_ENGINE_PORT=${HEAT_ENGINE_PORT:-8001}
|
|
|
|
HEAT_ENGINE_PORT=${HEAT_ENGINE_PORT:-8001}
|
|
|
|
HEAT_API_CW_HOST=${HEAT_API_CW_HOST:-$HOST_IP}
|
|
|
|
|
|
|
|
HEAT_API_CW_PORT=${HEAT_API_CW_PORT:-8003}
|
|
|
|
|
|
|
|
HEAT_API_PASTE_FILE=$HEAT_CONF_DIR/api-paste.ini
|
|
|
|
HEAT_API_PASTE_FILE=$HEAT_CONF_DIR/api-paste.ini
|
|
|
|
HEAT_POLICY_FILE=$HEAT_CONF_DIR/policy.json
|
|
|
|
HEAT_POLICY_FILE=$HEAT_CONF_DIR/policy.json
|
|
|
|
|
|
|
|
|
|
|
@ -132,11 +128,9 @@ function configure_heat {
|
|
|
|
if [[ "$HEAT_USE_APACHE" == "True" && "$WSGI_MODE" == "uwsgi" ]]; then
|
|
|
|
if [[ "$HEAT_USE_APACHE" == "True" && "$WSGI_MODE" == "uwsgi" ]]; then
|
|
|
|
iniset $HEAT_CONF DEFAULT heat_metadata_server_url http://$HEAT_API_CFN_HOST/heat-api-cfn
|
|
|
|
iniset $HEAT_CONF DEFAULT heat_metadata_server_url http://$HEAT_API_CFN_HOST/heat-api-cfn
|
|
|
|
iniset $HEAT_CONF DEFAULT heat_waitcondition_server_url http://$HEAT_API_CFN_HOST/heat-api-cfn/v1/waitcondition
|
|
|
|
iniset $HEAT_CONF DEFAULT heat_waitcondition_server_url http://$HEAT_API_CFN_HOST/heat-api-cfn/v1/waitcondition
|
|
|
|
iniset $HEAT_CONF DEFAULT heat_watch_server_url http://$HEAT_API_CW_HOST/heat-api-cloudwatch
|
|
|
|
|
|
|
|
else
|
|
|
|
else
|
|
|
|
iniset $HEAT_CONF DEFAULT heat_metadata_server_url http://$HEAT_API_CFN_HOST:$HEAT_API_CFN_PORT
|
|
|
|
iniset $HEAT_CONF DEFAULT heat_metadata_server_url http://$HEAT_API_CFN_HOST:$HEAT_API_CFN_PORT
|
|
|
|
iniset $HEAT_CONF DEFAULT heat_waitcondition_server_url http://$HEAT_API_CFN_HOST:$HEAT_API_CFN_PORT/v1/waitcondition
|
|
|
|
iniset $HEAT_CONF DEFAULT heat_waitcondition_server_url http://$HEAT_API_CFN_HOST:$HEAT_API_CFN_PORT/v1/waitcondition
|
|
|
|
iniset $HEAT_CONF DEFAULT heat_watch_server_url http://$HEAT_API_CW_HOST:$HEAT_API_CW_PORT
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
iniset $HEAT_CONF database connection `database_connection_url heat`
|
|
|
|
iniset $HEAT_CONF database connection `database_connection_url heat`
|
|
|
@ -169,7 +163,6 @@ function configure_heat {
|
|
|
|
# approximation.
|
|
|
|
# approximation.
|
|
|
|
iniset "$HEAT_API_UWSGI_CONF" uwsgi threads 4
|
|
|
|
iniset "$HEAT_API_UWSGI_CONF" uwsgi threads 4
|
|
|
|
write_uwsgi_config "$HEAT_CFN_API_UWSGI_CONF" "$HEAT_CFN_API_UWSGI" "/heat-api-cfn"
|
|
|
|
write_uwsgi_config "$HEAT_CFN_API_UWSGI_CONF" "$HEAT_CFN_API_UWSGI" "/heat-api-cfn"
|
|
|
|
write_uwsgi_config "$HEAT_CW_API_UWSGI_CONF" "$HEAT_CW_API_UWSGI" "/heat-api-cloudwatch"
|
|
|
|
|
|
|
|
else
|
|
|
|
else
|
|
|
|
_config_heat_apache_wsgi
|
|
|
|
_config_heat_apache_wsgi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
@ -202,9 +195,6 @@ function configure_heat {
|
|
|
|
# Cloudformation API
|
|
|
|
# Cloudformation API
|
|
|
|
iniset $HEAT_CONF heat_api_cfn bind_port $HEAT_API_CFN_PORT
|
|
|
|
iniset $HEAT_CONF heat_api_cfn bind_port $HEAT_API_CFN_PORT
|
|
|
|
|
|
|
|
|
|
|
|
# Cloudwatch API
|
|
|
|
|
|
|
|
iniset $HEAT_CONF heat_api_cloudwatch bind_port $HEAT_API_CW_PORT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if is_ssl_enabled_service "key" || is_service_enabled tls-proxy; then
|
|
|
|
if is_ssl_enabled_service "key" || is_service_enabled tls-proxy; then
|
|
|
|
iniset $HEAT_CONF clients_keystone ca_file $SSL_BUNDLE_FILE
|
|
|
|
iniset $HEAT_CONF clients_keystone ca_file $SSL_BUNDLE_FILE
|
|
|
|
fi
|
|
|
|
fi
|
|
|
@ -318,29 +308,24 @@ function start_heat {
|
|
|
|
if [[ -f ${enabled_site_file} && "$WSGI_MODE" != "uwsgi" ]]; then
|
|
|
|
if [[ -f ${enabled_site_file} && "$WSGI_MODE" != "uwsgi" ]]; then
|
|
|
|
enable_apache_site heat-api
|
|
|
|
enable_apache_site heat-api
|
|
|
|
enable_apache_site heat-api-cfn
|
|
|
|
enable_apache_site heat-api-cfn
|
|
|
|
enable_apache_site heat-api-cloudwatch
|
|
|
|
|
|
|
|
restart_apache_server
|
|
|
|
restart_apache_server
|
|
|
|
tail_log heat-api /var/log/$APACHE_NAME/heat_api.log
|
|
|
|
tail_log heat-api /var/log/$APACHE_NAME/heat_api.log
|
|
|
|
tail_log heat-api-access /var/log/$APACHE_NAME/heat_api_access.log
|
|
|
|
tail_log heat-api-access /var/log/$APACHE_NAME/heat_api_access.log
|
|
|
|
tail_log heat-api-cfn /var/log/$APACHE_NAME/heat_api_cfn.log
|
|
|
|
tail_log heat-api-cfn /var/log/$APACHE_NAME/heat_api_cfn.log
|
|
|
|
tail_log heat-api-cfn-access /var/log/$APACHE_NAME/heat_api_cfn_access.log
|
|
|
|
tail_log heat-api-cfn-access /var/log/$APACHE_NAME/heat_api_cfn_access.log
|
|
|
|
tail_log heat-api-cloudwatch /var/log/$APACHE_NAME/heat_api_cloudwatch.log
|
|
|
|
|
|
|
|
tail_log heat-api-cloudwatch-access /var/log/$APACHE_NAME/heat_api_cloudwatch_access.log
|
|
|
|
|
|
|
|
else
|
|
|
|
else
|
|
|
|
run_process h-api "$HEAT_BIN_DIR/uwsgi --ini $HEAT_API_UWSGI_CONF" ""
|
|
|
|
run_process h-api "$HEAT_BIN_DIR/uwsgi --ini $HEAT_API_UWSGI_CONF" ""
|
|
|
|
run_process h-api-cfn "$HEAT_BIN_DIR/uwsgi --ini $HEAT_CFN_API_UWSGI_CONF" ""
|
|
|
|
run_process h-api-cfn "$HEAT_BIN_DIR/uwsgi --ini $HEAT_CFN_API_UWSGI_CONF" ""
|
|
|
|
run_process h-api-cw "$HEAT_BIN_DIR/uwsgi --ini $HEAT_CW_API_UWSGI_CONF" ""
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
else
|
|
|
|
run_process h-api "$HEAT_BIN_DIR/heat-api --config-file=$HEAT_CONF"
|
|
|
|
run_process h-api "$HEAT_BIN_DIR/heat-api --config-file=$HEAT_CONF"
|
|
|
|
run_process h-api-cfn "$HEAT_BIN_DIR/heat-api-cfn --config-file=$HEAT_CONF"
|
|
|
|
run_process h-api-cfn "$HEAT_BIN_DIR/heat-api-cfn --config-file=$HEAT_CONF"
|
|
|
|
run_process h-api-cw "$HEAT_BIN_DIR/heat-api-cloudwatch --config-file=$HEAT_CONF"
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function _stop_processes {
|
|
|
|
function _stop_processes {
|
|
|
|
local serv
|
|
|
|
local serv
|
|
|
|
for serv in h-api h-api-cfn h-api-cw; do
|
|
|
|
for serv in h-api h-api-cfn; do
|
|
|
|
stop_process $serv
|
|
|
|
stop_process $serv
|
|
|
|
done
|
|
|
|
done
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -356,7 +341,6 @@ function stop_heat {
|
|
|
|
else
|
|
|
|
else
|
|
|
|
disable_apache_site heat-api
|
|
|
|
disable_apache_site heat-api
|
|
|
|
disable_apache_site heat-api-cfn
|
|
|
|
disable_apache_site heat-api-cfn
|
|
|
|
disable_apache_site heat-api-cloudwatch
|
|
|
|
|
|
|
|
restart_apache_server
|
|
|
|
restart_apache_server
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -364,16 +348,22 @@ function stop_heat {
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# TODO(ramishra): Remove after Queens
|
|
|
|
|
|
|
|
function stop_cw_service {
|
|
|
|
|
|
|
|
if $SYSTEMCTL is-enabled devstack@h-api-cw.service; then
|
|
|
|
|
|
|
|
$SYSTEMCTL stop devstack@h-api-cw.service
|
|
|
|
|
|
|
|
$SYSTEMCTL disable devstack@h-api-cw.service
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# _cleanup_heat_apache_wsgi() - Remove wsgi files, disable and remove apache vhost file
|
|
|
|
# _cleanup_heat_apache_wsgi() - Remove wsgi files, disable and remove apache vhost file
|
|
|
|
function _cleanup_heat_apache_wsgi {
|
|
|
|
function _cleanup_heat_apache_wsgi {
|
|
|
|
if [[ "$WSGI_MODE" == "uwsgi" ]]; then
|
|
|
|
if [[ "$WSGI_MODE" == "uwsgi" ]]; then
|
|
|
|
remove_uwsgi_config "$HEAT_API_UWSGI_CONF" "$HEAT_API_UWSGI"
|
|
|
|
remove_uwsgi_config "$HEAT_API_UWSGI_CONF" "$HEAT_API_UWSGI"
|
|
|
|
remove_uwsgi_config "$HEAT_CFN_API_UWSGI_CONF" "$HEAT_CFN_API_UWSGI"
|
|
|
|
remove_uwsgi_config "$HEAT_CFN_API_UWSGI_CONF" "$HEAT_CFN_API_UWSGI"
|
|
|
|
remove_uwsgi_config "$HEAT_CW_API_UWSGI_CONF" "$HEAT_CW_API_UWSGI"
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
sudo rm -f $(apache_site_config_for heat-api)
|
|
|
|
sudo rm -f $(apache_site_config_for heat-api)
|
|
|
|
sudo rm -f $(apache_site_config_for heat-api-cfn)
|
|
|
|
sudo rm -f $(apache_site_config_for heat-api-cfn)
|
|
|
|
sudo rm -f $(apache_site_config_for heat-api-cloudwatch)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# _config_heat_apache_wsgi() - Set WSGI config files of Heat
|
|
|
|
# _config_heat_apache_wsgi() - Set WSGI config files of Heat
|
|
|
@ -383,14 +373,11 @@ function _config_heat_apache_wsgi {
|
|
|
|
heat_apache_conf=$(apache_site_config_for heat-api)
|
|
|
|
heat_apache_conf=$(apache_site_config_for heat-api)
|
|
|
|
local heat_cfn_apache_conf
|
|
|
|
local heat_cfn_apache_conf
|
|
|
|
heat_cfn_apache_conf=$(apache_site_config_for heat-api-cfn)
|
|
|
|
heat_cfn_apache_conf=$(apache_site_config_for heat-api-cfn)
|
|
|
|
local heat_cloudwatch_apache_conf
|
|
|
|
|
|
|
|
heat_cloudwatch_apache_conf=$(apache_site_config_for heat-api-cloudwatch)
|
|
|
|
|
|
|
|
local heat_ssl=""
|
|
|
|
local heat_ssl=""
|
|
|
|
local heat_certfile=""
|
|
|
|
local heat_certfile=""
|
|
|
|
local heat_keyfile=""
|
|
|
|
local heat_keyfile=""
|
|
|
|
local heat_api_port=$HEAT_API_PORT
|
|
|
|
local heat_api_port=$HEAT_API_PORT
|
|
|
|
local heat_cfn_api_port=$HEAT_API_CFN_PORT
|
|
|
|
local heat_cfn_api_port=$HEAT_API_CFN_PORT
|
|
|
|
local heat_cw_api_port=$HEAT_API_CW_PORT
|
|
|
|
|
|
|
|
local venv_path=""
|
|
|
|
local venv_path=""
|
|
|
|
|
|
|
|
|
|
|
|
sudo cp $HEAT_FILES_DIR/heat-api.conf $heat_apache_conf
|
|
|
|
sudo cp $HEAT_FILES_DIR/heat-api.conf $heat_apache_conf
|
|
|
@ -419,18 +406,6 @@ function _config_heat_apache_wsgi {
|
|
|
|
s|%VIRTUALENV%|$venv_path|g
|
|
|
|
s|%VIRTUALENV%|$venv_path|g
|
|
|
|
" -i $heat_cfn_apache_conf
|
|
|
|
" -i $heat_cfn_apache_conf
|
|
|
|
|
|
|
|
|
|
|
|
sudo cp $HEAT_FILES_DIR/heat-api-cloudwatch.conf $heat_cloudwatch_apache_conf
|
|
|
|
|
|
|
|
sudo sed -e "
|
|
|
|
|
|
|
|
s|%PUBLICPORT%|$heat_cw_api_port|g;
|
|
|
|
|
|
|
|
s|%APACHE_NAME%|$APACHE_NAME|g;
|
|
|
|
|
|
|
|
s|%HEAT_BIN_DIR%|$HEAT_BIN_DIR|g;
|
|
|
|
|
|
|
|
s|%API_WORKERS%|$API_WORKERS|g;
|
|
|
|
|
|
|
|
s|%SSLENGINE%|$heat_ssl|g;
|
|
|
|
|
|
|
|
s|%SSLCERTFILE%|$heat_certfile|g;
|
|
|
|
|
|
|
|
s|%SSLKEYFILE%|$heat_keyfile|g;
|
|
|
|
|
|
|
|
s|%USER%|$STACK_USER|g;
|
|
|
|
|
|
|
|
s|%VIRTUALENV%|$venv_path|g
|
|
|
|
|
|
|
|
" -i $heat_cloudwatch_apache_conf
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|