#!/bin/sh

mkdir -p /etc/sysconfig
cat > /etc/sysconfig/heat-params <<EOF
HTTP_PROXY="$HTTP_PROXY"
HTTPS_PROXY="$HTTPS_PROXY"
NO_PROXY="$NO_PROXY"

AUTH_URL="$AUTH_URL"
USERNAME="$USERNAME"
PASSWORD="$PASSWORD"
TENANT_NAME="$TENANT_NAME"
VOLUME_DRIVER="$VOLUME_DRIVER"
REGION_NAME="$REGION_NAME"
DOMAIN_NAME="$DOMAIN_NAME"
REXRAY_PREEMPT="$REXRAY_PREEMPT"

CLUSTER_NAME="$CLUSTER_NAME"

EXHIBITOR_STORAGE_BACKEND="$EXHIBITOR_STORAGE_BACKEND"
EXHIBITOR_ZK_HOSTS="$EXHIBITOR_ZK_HOSTS"
EXHIBITOR_ZK_PATH="$EXHIBITOR_ZK_PATH"
AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID"
AWS_REGIION="$AWS_REGIION"
AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY"
EXHIBITOR_EXPLICIT_KEYS="$EXHIBITOR_EXPLICIT_KEYS"
S3_BUCKET="$S3_BUCKET"
S3_PREFIX="$S3_PREFIX"
EXHIBITOR_AZURE_ACCOUNT_NAME="$EXHIBITOR_AZURE_ACCOUNT_NAME"
EXHIBITOR_AZURE_ACCOUNT_KEY="$EXHIBITOR_AZURE_ACCOUNT_KEY"
EXHIBITOR_AZURE_PREFIX="$EXHIBITOR_AZURE_PREFIX"

MASTER_DISCOVERY="$MASTER_DISCOVERY"
MASTER_LIST="$MASTER_LIST"
EXHIBITOR_ADDRESS="$EXHIBITOR_ADDRESS"
NUM_MASTERS="$NUM_MASTERS"

DCOS_OVERLAY_ENABLE="$DCOS_OVERLAY_ENABLE"
DCOS_OVERLAY_CONFIG_ATTEMPTS="$DCOS_OVERLAY_CONFIG_ATTEMPTS"
DCOS_OVERLAY_MTU="$DCOS_OVERLAY_MTU"
DCOS_OVERLAY_NETWORK="$DCOS_OVERLAY_NETWORK"

DNS_SEARCH="$DNS_SEARCH"
RESOLVERS="$RESOLVERS"

CHECK_TIME="$CHECK_TIME"
DOCKER_REMOVE_DELAY="$DOCKER_REMOVE_DELAY"
GC_DELAY="$GC_DELAY"
LOG_DIRECTORY="$LOG_DIRECTORY"
PROCESS_TIMEOUT="$PROCESS_TIMEOUT"

OAUTH_ENABLED="$OAUTH_ENABLED"
TELEMETRY_ENABLED="$TELEMETRY_ENABLED"

ROLES="$ROLES"
EOF
