Commit 3d4a3471 by e0d

Merge pull request #749 from edx/e0d/commoncluster

E0d/commoncluster
parents 95563a7f e01f7b68
#Variables for rabbitmq #Variables for rabbitmq
--- ---
rabbit_app_dir: "{{ COMMON_APP_DIR }}/rabbitmq"
rabbit_data_dir: "{{ COMMON_DATA_DIR }}/rabbitmq"
rabbit_log_dir: "{{ COMMON_LOG_DIR }}/rabbitmq"
rabbit_cfg_dir: "{{ COMMON_CFG_DIR }}/rabbitmq"
# Environment specific vars # Environment specific vars
RABBIT_ERLANG_COOKIE: 'DEFAULT_COOKIE' RABBIT_ERLANG_COOKIE: 'DEFAULT_COOKIE'
RABBIT_USERS: RABBIT_USERS:
...@@ -42,11 +47,6 @@ rabbitmq_auth_config: ...@@ -42,11 +47,6 @@ rabbitmq_auth_config:
erlang_cookie: $RABBIT_ERLANG_COOKIE erlang_cookie: $RABBIT_ERLANG_COOKIE
admins: $RABBIT_USERS admins: $RABBIT_USERS
# 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: [] rabbitmq_clustered_hosts: []
rabbitmq_plugins: rabbitmq_plugins:
......
...@@ -48,7 +48,8 @@ ...@@ -48,7 +48,8 @@
- name: add rabbitmq cluster configuration - name: add rabbitmq cluster configuration
template: > template: >
src=rabbitmq.config.j2 dest={{rabbitmq_config_dir}}/rabbitmq.config src=etc/rabbitmq/rabbitmq.config.j2
dest={{rabbitmq_config_dir}}/rabbitmq.config
owner=root group=root mode=0644 owner=root group=root mode=0644
register: cluster_configuration register: cluster_configuration
......
{# Get the list of hosts that are in the same stack as the current machine % {{ ansible_managed }}
and also a rabbitmq machine.
#}
{%- if RABBITMQ_CLUSTERED -%} {%- if RABBITMQ_CLUSTERED -%}
{%- set hosts= [] -%} {%- set hosts= [] -%}
{%- set all_rabbit_hosts = [] -%}
{%- do all_rabbit_hosts.extend(groups.tag_role_rabbitmq) -%} {%- for host in hostvars.keys() -%}
{%- do all_rabbit_hosts.extend(groups.tag_group_rabbitmq) -%} {% do hosts.append("rabbit@ip-" + host.replace('.','-')) %}
{%- for name in group_names -%} {%- endfor %}
{%- if name.startswith(rabbitmq_aws_stack_name) -%}
{%- for host in all_rabbit_hosts -%}
{%- if host in groups[name] -%}
{% do hosts.append("rabbit@ip-" + host.replace('.','-')) %}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- endfor -%}
[{rabbit, [{rabbit,
[{cluster_nodes, {['{{ hosts|join("\',\'") }}'], disc}}]}]. [{cluster_nodes, {['{{ hosts|join("\',\'") }}'], disc}}]}].
......
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