Commit 6b22eae8 by Feanil Patel

Stop using the RABBITMQ_CLUSTERED var and tooling.

This method relied on the `hostvars` variable provided by ansible to always
be all the nodes in the rabbitmq cluster.  The hostvars var broke as a result
of the upgrade to ansible 1.9 but also even if it did work, this method
required that you always run rabbit plays on the whole cluster.  This is not
reasonable as it makes it very hard to heal a single node that may have fallen
over.

From here on, the RABBITMQ_CLUSTERED_HOSTS var should be used instead to
specify the rabbit hosts that are part of a cluster.
parent 4c3456e8
- Role: rabbitmq
- Removed the RABBITMQ_CLUSTERED var and related tooling. The goal of the var was to be able to setup a cluster in the aws environment without having to know all the IPs of the cluster before hand. It relied on the `hostvars` ansible varible to work correctly which it no longer does in 1.9. This may get fixed in the future but for now, the "magic" setup doesn't work.
- Changed `rabbitmq_clustered_hosts` to RABBITMQ_CLUSTERED_HOSTS.
- Role: edxapp
- Removed SUBDOMAIN_BRANDING and SUBDOMAIN_COURSE_LISTINGS variables
......
......@@ -19,11 +19,11 @@ RABBIT_USERS:
- name: 'celery'
password: 'celery'
RABBITMQ_CLUSTERED: !!null
RABBITMQ_VHOSTS:
- '/'
RABBITMQ_CLUSTERED_HOSTS: []
# Internal role variables below this line
# option to force deletion of the mnesia dir
......@@ -56,7 +56,5 @@ rabbitmq_auth_config:
erlang_cookie: "{{ RABBIT_ERLANG_COOKIE }}"
admins: "{{ RABBIT_USERS }}"
rabbitmq_clustered_hosts: []
rabbitmq_plugins:
- rabbitmq_management
......@@ -2,19 +2,8 @@
[{rabbit, [
{log_levels, [{connection, info}]},
{% if RABBITMQ_CLUSTERED -%}
{%- set hosts= [] -%}
{%- for host in hostvars.keys() -%}
{% do hosts.append("rabbit@ip-" + host.replace('.','-')) %}
{%- endfor %}
{cluster_nodes, {['{{ hosts|join("\',\'") }}'], disc}}
{%- else -%}
{# If rabbitmq_clustered_hosts is set, use that instead assuming an aws stack.
{# If RABBITMQ_CLUSTERED_HOSTS is set, use that instead assuming an aws stack.
Note: That these names should include the node name prefix. eg. 'rabbit@hostname'
#}
{cluster_nodes, {['{{ rabbitmq_clustered_hosts|join("\',\'") }}'], disc}}
{%- endif %}
{cluster_nodes, {['{{ RABBITMQ_CLUSTERED_HOSTS|join("\',\'") }}'], disc}}
]}].
......@@ -28,7 +28,7 @@
serial: 1
gather_facts: True
vars:
rabbitmq_clustered_hosts:
RABBITMQ_CLUSTERED_HOSTS:
- "rabbit@cluster1"
- "rabbit@cluster2"
- "rabbit@cluster3"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment