Got clustering working

Together with Wim
Albeit a bit dirty: we need to make the node names variable..
This commit is contained in:
Egon Rijpkema 2017-05-23 16:55:18 +02:00
parent f74bd927e3
commit 29b4f06ac7
2 changed files with 8 additions and 4 deletions

5
hosts
View File

@ -5,8 +5,9 @@ ansible-test
[registry]
ansible-test
[rabbitmq]
ansible-test-mq
ansible-test
ansible-test-2
ansible-test-3

View File

@ -10,9 +10,12 @@ ExecStartPre=-/usr/bin/docker stop %n
ExecStartPre=-/usr/bin/docker rm %n
ExecStartPre=/usr/bin/docker pull rabbitmq:latest
ExecStart=/usr/bin/docker run \
-p 4369:4369 -p 25679:25679 -p 5671-5672:5671-5672 -p 8080:15672 \
--add-host ansible-test:172.23.38.125 --add-host ansible-test-2:172.23.38.127 --add-host ansible-test-3:172.23.38.128 \
-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=password" \
--hostname rabbitmq --name %n rabbitmq:3-management
-e "RABBITMQ_ERLANG_COOKIE=IHyW9HpfbXRL+pZkhGd8pA==" \
-e "RABBITMQ_NODENAME=rabbit_{{ ansible_nodename }}" \
--hostname "{{ansible_nodename}}" --name %n rabbitmq:3-management
[Install]
WantedBy=multi-user.target