2017-05-16 15:52:22 +02:00
|
|
|
[Unit]
|
|
|
|
Description=rabbitmq Container
|
|
|
|
After=docker.service
|
|
|
|
Requires=docker.service
|
2017-07-07 14:40:20 +02:00
|
|
|
|
2017-05-16 15:52:22 +02:00
|
|
|
[Service]
|
|
|
|
TimeoutStartSec=0
|
|
|
|
Restart=always
|
2017-08-14 16:40:06 +02:00
|
|
|
ExecStartPre=-/usr/bin/docker kill %n
|
2017-05-16 15:52:22 +02:00
|
|
|
ExecStartPre=-/usr/bin/docker rm %n
|
|
|
|
ExecStartPre=/usr/bin/docker pull rabbitmq:latest
|
2017-05-23 15:20:58 +02:00
|
|
|
ExecStart=/usr/bin/docker run \
|
2017-08-31 15:02:47 +02:00
|
|
|
{% for host in groups['rabbitmq'] %}
|
|
|
|
--add-host "{{ host }}:{{ hostvars[host]['listen_ip'] | default(hostvars[host]['ansible_default_ipv4']['address']) }}" \
|
|
|
|
{% endfor %}
|
2017-05-23 16:55:18 +02:00
|
|
|
-p 4369:4369 -p 25679:25679 -p 25672:25672 -p 5671-5672:5671-5672 -p 8080:15672 \
|
2017-08-31 15:02:47 +02:00
|
|
|
-e "RABBITMQ_DEFAULT_USER=openstack" -e "RABBITMQ_DEFAULT_PASS={{ secrets['RABBIT_PASSWORD'] }}" \
|
2017-08-14 16:40:06 +02:00
|
|
|
-e "RABBITMQ_ERLANG_COOKIE={{ secrets['RABBITMQ_ERLANG_COOKIE'] }}" \
|
2017-05-23 16:55:18 +02:00
|
|
|
-e "RABBITMQ_NODENAME=rabbit_{{ ansible_nodename }}" \
|
2017-07-07 16:14:38 +02:00
|
|
|
--hostname "{{ ansible_nodename }}" --name %n rabbitmq:3-management
|
2017-07-07 14:40:20 +02:00
|
|
|
|
2017-05-16 15:52:22 +02:00
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|