diff options
author | Larry Smith Jr <larry.e.smith.jr@gmail.com> | 2015-07-29 18:38:22 -0400 |
---|---|---|
committer | Larry Smith Jr <larry.e.smith.jr@gmail.com> | 2015-07-29 18:38:22 -0400 |
commit | eb299d9b8716d8c5b0bdede17e29ada1f623fe43 (patch) | |
tree | 9a557f66b701f072d09fd4cdfa9404e91bf41c1a /tasks/rabbitmq_clustering.yml | |
download | ansible-rabbitmq-eb299d9b8716d8c5b0bdede17e29ada1f623fe43.tar.gz ansible-rabbitmq-eb299d9b8716d8c5b0bdede17e29ada1f623fe43.tar.zst ansible-rabbitmq-eb299d9b8716d8c5b0bdede17e29ada1f623fe43.zip |
first commit
Diffstat (limited to 'tasks/rabbitmq_clustering.yml')
-rw-r--r-- | tasks/rabbitmq_clustering.yml | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/tasks/rabbitmq_clustering.yml b/tasks/rabbitmq_clustering.yml new file mode 100644 index 0000000..29db18c --- /dev/null +++ b/tasks/rabbitmq_clustering.yml | |||
@@ -0,0 +1,40 @@ | |||
1 | --- | ||
2 | - name: rabbitmq_clustering | config | stopping rabbitmq app | ||
3 | command: rabbitmqctl stop_app | ||
4 | |||
5 | - name: rabbitmq_clustering | config | resetting rabbitmq app | ||
6 | command: rabbitmqctl reset | ||
7 | |||
8 | - name: rabbitmq_clustering | config | copy erlang cookie | ||
9 | template: src=erlang.cookie.j2 dest=/var/lib/rabbitmq/.erlang.cookie owner=rabbitmq group=rabbitmq mode=0400 backup=yes | ||
10 | |||
11 | - name: rabbitmq_clustering | config | starting rabbitmq app | ||
12 | command: rabbitmqctl start_app | ||
13 | when: inventory_hostname == "{{ master_rabbit_node }}" | ||
14 | |||
15 | - name: rabbitmq_clustering | config | sending sigterm to any running rabbitmq processes | ||
16 | shell: pkill -u rabbitmq || true | ||
17 | when: inventory_hostname != "{{ master_rabbit_node }}" | ||
18 | |||
19 | - name: rabbitmq_clustering | config | restarting rabbitmq-server | ||
20 | service: name=rabbitmq-server state=restarted | ||
21 | when: inventory_hostname != "{{ master_rabbit_node }}" | ||
22 | |||
23 | - name: rabbitmq_clustering | config | stopping rabbitmq app | ||
24 | command: rabbitmqctl stop_app | ||
25 | when: inventory_hostname != "{{ master_rabbit_node }}" | ||
26 | |||
27 | - name: rabbitmq_clustering | config | resetting rabbitmq app | ||
28 | command: rabbitmqctl reset | ||
29 | when: inventory_hostname != "{{ master_rabbit_node }}" | ||
30 | |||
31 | - name: rabbitmq_clustering | config | joining rabbitmq cluster | ||
32 | command: rabbitmqctl join_cluster 'rabbit@{{ master_rabbit_node }}' | ||
33 | when: inventory_hostname != "{{ master_rabbit_node }}" | ||
34 | |||
35 | - name: rabbitmq_clustering | config | starting rabbitmq app | ||
36 | command: rabbitmqctl start_app | ||
37 | when: inventory_hostname != "{{ master_rabbit_node }}" | ||
38 | |||
39 | - name: rabbitmq_clustering | config | marking as clustered | ||
40 | file: path=/etc/rabbitmq/clustered state=touch | ||