#!/bin/bash

set -xe

# Assumption: The broker is running in production mode. Users of
# development mode are on their own.

# Backup broker.conf.
conf='/etc/openshift/broker.conf'
command cp -f "$conf"{,.ugsave.`date +%Y-%m-%d-%H:%M:%S`}


# The ALLOW_MULTIPLE_HAPROXY_ON_NODE option did not exist in RHOSE 2.0.
cat <<EOF >> "$conf"

# This configuration determines if multiple haproxy gears can be hosted on the same node. 
# If allowed, the frontend apache will route the web traffic being sent to this node 
# using the app_dns or the alias to ONLY one of the haproxy gears that has the mapping. 
# To avoid this situation, this flag should be set to false in production environments.
ALLOW_MULTIPLE_HAPROXY_ON_NODE="false"
EOF
