Introducing listen_ip variable that overrides

the default listen_ip.

make a loop for more flexibility.

Get a listen ip specifically for that host.

see if components have listen_ip defined before using ansible_default_ipv4

Make service files look for listen_ip variable.

implemented listen_ip variable here too
This commit is contained in:
Egon Rijpkema
2017-09-19 16:49:38 +02:00
parent 30c453e32b
commit 44077aade9
12 changed files with 63 additions and 63 deletions

View File

@ -11,7 +11,7 @@ ExecStartPre=-/usr/bin/docker rm %n
ExecStartPre=/usr/bin/docker pull rabbitmq:latest
ExecStart=/usr/bin/docker run \
{% for host in groups['rabbitmq'] %}
--add-host "{{ host }}:{{ hostvars[host]['ansible_default_ipv4']['address'] }}" \
--add-host "{{ host }}:{{ hostvars[host]['listen_ip'] | default(hostvars[host]['ansible_default_ipv4']['address']) }}" \
{% endfor %}
-p 4369:4369 -p 25679:25679 -p 25672:25672 -p 5671-5672:5671-5672 -p 8080:15672 \
-e "RABBITMQ_DEFAULT_USER=user" -e "RABBITMQ_DEFAULT_PASS={{ secrets['RABBIT_PASSWORD'] }}" \