Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
configuration
Commits
3d4a3471
Commit
3d4a3471
authored
Feb 06, 2014
by
e0d
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #749 from edx/e0d/commoncluster
E0d/commoncluster
parents
95563a7f
e01f7b68
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
22 deletions
+13
-22
playbooks/roles/rabbitmq/defaults/main.yml
+5
-5
playbooks/roles/rabbitmq/tasks/main.yml
+2
-1
playbooks/roles/rabbitmq/templates/etc/rabbitmq/rabbitmq.config.j2
+6
-16
No files found.
playbooks/roles/rabbitmq/defaults/main.yml
View file @
3d4a3471
#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
:
...
...
playbooks/roles/rabbitmq/tasks/main.yml
View file @
3d4a3471
...
@@ -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
...
...
playbooks/roles/rabbitmq/templates/rabbitmq.config.j2
→
playbooks/roles/rabbitmq/templates/
etc/rabbitmq/
rabbitmq.config.j2
View file @
3d4a3471
{# 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}}]}].
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment