Commit 0d284539 by Feanil Patel

Add support for alternate cluster hosts.

parent 4ada894c
{# Get the list of hosts that are in the same stack as the current machine
and also a rabbitmq machine.
#}
{%- if rabbitmq_clustered_hosts|length == 0 -%}
{%- set hosts= [] -%}
{%- for name in group_names -%}
{%- if name.startswith("tag_aws_cloudformation_stack-name_") -%}
{%- if name.startswith(rabbitmq_aws_stack_name) -%}
{%- for host in groups.tag_group_rabbitmq -%}
{%- if host in groups[name] -%}
{% do hosts.append("rabbit@ip-" + host.replace('.','-')) %}
......@@ -14,3 +16,12 @@
[{rabbit,
[{cluster_nodes, {['{{ hosts|join("\',\'") }}'], disc}}]}].
{%- else -%}
{# 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'
#}
[{rabbit,
[{cluster_nodes, {['{{ rabbitmq_clustered_hosts|join("\',\'") }}'], disc}}]}].
{%- endif -%}
......@@ -14,3 +14,10 @@ rabbitmq_port: 5672
rabbitmq_auth_config:
erlang_cookie: "CHANGE ME"
# If the system is running out of an Amazon Web Services
# cloudformation stack, this group name can used to pull out
# the name of the stack the rabbit server resides in.
rabbitmq_aws_stack_name: "tag_aws_cloudformation_stack-name_"
rabbitmq_clustered_hosts: []
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