Skip to content
This repository was archived by the owner on Jun 12, 2018. It is now read-only.

Commit 1720038

Browse files
author
Nicolas Huray
committed
Resolve EC2 IP running a Consul Agent through API
1 parent 7139cf5 commit 1720038

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

  • consul/etc/services.d/consul-template

consul/etc/services.d/consul-template/run

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#!/usr/bin/with-contenv sh
22
set -e
33

4-
if [ -n ${RUN_ON_AWS} ]; then
4+
if [ -z ${RUN_ON_AWS} ]; then
5+
CONSUL_URL=${CONSUL_URL:-localhost:8500}
6+
else
57
# Resolve the EC2 IP running a Consul Agent through API
8+
# This a workaround for this issue : https://github.com/aws/amazon-ecs-agent/issues/185
69
CONSUL_URL=$(curl http://169.254.169.254/latest/meta-data/local-hostname)
7-
else
8-
CONSUL_URL=${CONSUL_URL:-localhost:8500}
910
fi
1011

1112
if [ -d /etc/consul-template/conf ]; then

0 commit comments

Comments
 (0)