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
7d97dda7
Commit
7d97dda7
authored
Oct 07, 2014
by
Feanil Patel
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1608 from edx/feanil/common_cluster_updates
Feanil/common cluster updates
parents
b01577ea
3032ba82
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
13 deletions
+8
-13
playbooks/edx-east/cluster_rabbitmq.yml
+3
-8
playbooks/roles/rabbitmq/templates/etc/rabbitmq/rabbitmq.config.j2
+5
-5
No files found.
playbooks/edx-east/cluster_rabbitmq.yml
View file @
7d97dda7
# ansible-playbook -i ec2.py c
ommoncluster
.yml --limit tag_Name_stage-edx-commoncluster -e@/path/to/vars/env-deployment.yml -T 30 --list-hosts
# ansible-playbook -i ec2.py c
luster_rabbitmq
.yml --limit tag_Name_stage-edx-commoncluster -e@/path/to/vars/env-deployment.yml -T 30 --list-hosts
-
hosts
:
all
sudo
:
True
...
...
@@ -28,14 +28,9 @@
tasks
:
-
debug
:
msg="{{ ansible_ec2_local_ipv4 }}"
with_items
:
list.results
-
shell
:
echo "rabbit@ip-{{ item|replace('.', '-') }}"
when
:
item != ansible_ec2_local_ipv4
with_items
:
hostvars.keys()
register
:
list
-
command
:
rabbitmqctl stop_app
-
command
:
rabbitmqctl join_cluster {{ item.stdout }}
when
:
item.stdout is defined
with_items
:
list.results
-
command
:
rabbitmqctl join_cluster rabbit@ip-{{ hostvars.keys()[0]|replace('.', '-') }}
when
:
hostvars.keys()[0] != ansible_ec2_local_ipv4
-
command
:
rabbitmqctl start_app
post_tasks
:
-
debug
:
var="{{ ansible_ec2_instance_id }}"
...
...
playbooks/roles/rabbitmq/templates/etc/rabbitmq/rabbitmq.config.j2
View file @
7d97dda7
% {{ ansible_managed }}
[{rabbit,
{log_levels, [{connection, info}]},
{% if RABBITMQ_CLUSTERED -%}
{%- set hosts= [] -%}
...
...
@@ -7,14 +9,12 @@
{% do hosts.append("rabbit@ip-" + host.replace('.','-')) %}
{%- endfor %}
[{rabbit,
[{cluster_nodes, {['{{ hosts|join("\',\'") }}'], disc}}]}].
[{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}}]}].
[{cluster_nodes, {['{{ rabbitmq_clustered_hosts|join("\',\'") }}'], disc}}]
{%- endif -%}
}].
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