Skip to content

Commit

Permalink
move to bind expression
Browse files Browse the repository at this point in the history
  • Loading branch information
m8rge committed Feb 6, 2018
1 parent f42e7fb commit ab4af2c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions init.d/01_consul.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ if [ "$PAIR" = "" ]; then
exit 1
fi

if [ -z $CONSUL_BIND ]; then
echo '0.0.0.0' > /etc/container_environment/CONSUL_BIND
if [ -z "$CONSUL_BIND_EXPR" ]; then
echo "Consul bind address expression not set, use default"
CONSUL_BIND_EXPR='"0.0.0.0"'
echo $CONSUL_BIND_EXPR > /etc/container_environment/CONSUL_BIND_EXPR
fi
echo "Bind consul to $CONSUL_BIND"
echo "Consul bind address expression set to $CONSUL_BIND_EXPR"

DC=$(echo $PAIR | cut -f1 -d " ")
DOMAIN=$(echo $PAIR | cut -f2 -d " ")
Expand Down
2 changes: 1 addition & 1 deletion services/consul.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exec /usr/local/bin/consul agent \
-retry-join $CONSUL_HOST \
-bind $CONSUL_BIND \
-bind "{{ $CONSUL_BIND_EXPR }}" \
-datacenter $CONSUL_DC \
-domain $CONSUL_DOMAIN \
-config-file /etc/consul/consul.json \
Expand Down

0 comments on commit ab4af2c

Please sign in to comment.