Skip to content

Commit

Permalink
Resolve autopilotpattern#23 by adding CONSUL_DATACENTER_NAME env
Browse files Browse the repository at this point in the history
  • Loading branch information
tjcelaya committed Dec 7, 2017
1 parent f0bf136 commit ea04c0f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bin/consul-manage
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ set -eo pipefail
preStart() {
_log "Updating consul advertise address"
sed -i "s/CONTAINERPILOT_CONSUL_IP/${CONTAINERPILOT_CONSUL_IP}/" /etc/consul/consul.hcl

_log "Updating consul datacenter name"
sed -i "s/CONSUL_DATACENTER_NAME/${CONSUL_DATACENTER_NAME:-dc1}/" /etc/consul/consul.hcl
}

#
Expand Down
1 change: 1 addition & 0 deletions etc/consul.hcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
bind_addr = "CONTAINERPILOT_CONSUL_IP"
datacenter = "CONSUL_DATACENTER_NAME"
data_dir = "/data"
client_addr = "0.0.0.0"
ports {
Expand Down
1 change: 1 addition & 0 deletions local-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ services:
- 8500
environment:
- CONSUL=consul
- CONSUL_DATACENTER_NAME=dc1
command: >
/usr/local/bin/containerpilot

0 comments on commit ea04c0f

Please sign in to comment.