ansible-st2
ansible-st2 copied to clipboard
(feature request) Adding tasks to set up cluster configuration in the RabbitMQ role
This is a much-needed project for us. I want to build StackStorm in production environment with this.
The current tasks in the RabbitMQ role just only install package and start service. But the RabbitMQ servers that I expect are set up a cluster configuration.
I want some tasks to set up cluster configuration in the RabbitMQ role.
Thank you.
Thanks for the feature request! I agree, cluster and HA-friendly deployment is must have story for production use.
And while it may take a lot of time to implement it, - all dependent services we have like RabbitMQ, Mongo, PostgreSQL could have a lot of advanced configuration to handle.
But for now I'd suggest alternative approach.
st2
role was written without hard dependency on internal rabbitmq
role.
So instead of https://github.com/StackStorm/ansible-st2/issues/120 you can use external rabbitmq role
and Configure with Existing Mongo, RabbitMQ, PostgreSQL installations #17
All we need now is to add respective ~st2.conf
messaging setting~ (done) in ansible-st2
so you could configure st2 to work with external rabbitmq cluster, deployed by another Ansible role.
Resulting play may look this way:
---
- name: Configure RabbitMQ cluster
hosts: rabbitmq-cluster
roles:
# See: https://github.com/alexey-medvedchikov/ansible-rabbitmq
- alexeymedvedchikov.rabbitmq
vars:
rabbitmq_create_cluster: yes
rabbitmq_erlang_cookie: st2-mq
rabbitmq_users:
- user: st2
password: st2
vhost: /
configure_priv: .*
read_priv: .*
write_priv: .*
tags: st2
- name: Install StackStorm
hosts: st2
roles:
- name: Install and Configure `st2` itself
role: st2
vars:
st2_messaging_url: "amqp://st2:st2@rabbitmq-cluster001:5672//"
- st2mistral
- st2web
- st2smoketests
Just for reference I found external Ansible Galaxy role alexeymedvedchikov.rabbitmq
which configures rabbitmq cluster https://github.com/alexey-medvedchikov/ansible-rabbitmq just to give an idea (I haven't tested it).
Approach like that with external rabbitmq cluster would be fast to do & efficient and I'd suggest to follow that way, but if you prefer long-term, - I'm fine with contributions too :+1: @userlocalhost Let me know your opinion.
cc @bigmstone I remember you was interested in deploying entire StackStorm in HA way internally. This might be useful discussion for you.
Thank you for your reply. I agree with you. It's reasonable to use some external playbook that specialize in a specific target, as you say.
So I'll close #120, then seek a playbook that suits the following requirements.
- can set up a cluster and HA queue.
- can add a user and set permissions of it for connecting from external node.
After that, I think I'll write a test for it.
Thought I would also chime in here and share an already available RabbitMQ Ansible role of mine which also provides HA. I would also be interested in helping out in anyway possible as well.
https://github.com/mrlesmithjr/ansible-rabbitmq