From 3ab300285ededa597be8243aae1dbd37a8397f0e Mon Sep 17 00:00:00 2001 From: "Scott S. Lowe" Date: Wed, 21 Sep 2016 11:08:58 -0600 Subject: [PATCH] Fix problem with Consul configuration on VirtualBox Edit Consul Upstart configuration to force Consul to bind to secondary Ethernet interface. This fixes problems when using this environment with VirtualBox. --- consul-ansible/consul.conf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/consul-ansible/consul.conf b/consul-ansible/consul.conf index d045021..60fa820 100644 --- a/consul-ansible/consul.conf +++ b/consul-ansible/consul.conf @@ -11,9 +11,11 @@ script fi export GOMAXPROCS=`nproc` +BIND_ADDR=`hostname -I | cut -f2 -d' '` exec /usr/local/bin/consul agent \ -config-dir="/etc/consul.d/server" \ + -bind $BIND_ADDR \ ${CONSUL_FLAGS} \ >>/var/log/consul.log 2>&1 -end script \ No newline at end of file +end script