From 29cf8baba56e4b703d7882a0778cfc10c25e5406 Mon Sep 17 00:00:00 2001 From: Adam Harwell Date: Fri, 28 Sep 2018 14:39:06 -0700 Subject: [PATCH] Fix haproxy server config for memcached backends Change-Id: I22a46b7c61f9ea4f449bc68a244caed2f6705d96 --- ansible/roles/memcached/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/memcached/defaults/main.yml b/ansible/roles/memcached/defaults/main.yml index f41635ede8..91fa58bf0a 100644 --- a/ansible/roles/memcached/defaults/main.yml +++ b/ansible/roles/memcached/defaults/main.yml @@ -27,7 +27,7 @@ memcached_services: #################### # HAProxy #################### -haproxy_members: "{% for host in groups['memcached'] %}server {{ host }} {{ host }}:{{ memcached_port }} check inter 2000 rise 2 fall 5{% if not loop.first %} backup{% endif %};{% endfor %}" +haproxy_members: "{% for host in groups['memcached'] %}server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ memcached_port }} check inter 2000 rise 2 fall 5{% if not loop.first %} backup{% endif %};{% endfor %}" #################### # Docker