aboutsummaryrefslogtreecommitdiffhomepage
path: root/tasks/rabbitmq_clustering.yml
diff options
context:
space:
mode:
authorLarry Smith Jr <mrlesmithjr@gmail.com>2016-12-03 17:50:41 -0500
committerLarry Smith Jr <mrlesmithjr@gmail.com>2016-12-03 17:50:41 -0500
commit8f8673fb8dfa2bd4fa2694cbfdcb6eed54e502de (patch)
treeaaaf71ac94a4bd065cefd8b3c75603efe3703d89 /tasks/rabbitmq_clustering.yml
parentda8e343df912e94703a8094f5e62d4c1bcc57345 (diff)
downloadansible-rabbitmq-8f8673fb8dfa2bd4fa2694cbfdcb6eed54e502de.tar.gz
ansible-rabbitmq-8f8673fb8dfa2bd4fa2694cbfdcb6eed54e502de.tar.zst
ansible-rabbitmq-8f8673fb8dfa2bd4fa2694cbfdcb6eed54e502de.zip
Updated gitignore
Signed-off-by: Larry Smith Jr <mrlesmithjr@gmail.com>
Diffstat (limited to 'tasks/rabbitmq_clustering.yml')
-rw-r--r--tasks/rabbitmq_clustering.yml70
1 files changed, 0 insertions, 70 deletions
diff --git a/tasks/rabbitmq_clustering.yml b/tasks/rabbitmq_clustering.yml
deleted file mode 100644
index 9dece46..0000000
--- a/tasks/rabbitmq_clustering.yml
+++ /dev/null
@@ -1,70 +0,0 @@
1---
2- name: rabbitmq_clustering | stopping rabbitmq app
3 command: rabbitmqctl stop_app
4
5- name: rabbitmq_clustering | resetting rabbitmq app
6 command: rabbitmqctl reset
7
8- name: rabbitmq_clustering | stopping rabbitmq-server
9 service:
10 name: rabbitmq-server
11 state: stopped
12
13#- name: grabbing erlang cookie
14# shell: cat /var/lib/rabbitmq/.erlang.cookie
15# register: rabbitmq_erlang_cookie
16# when: inventory_hostname == "{{ rabbitmq_master }}"
17
18- name: rabbitmq_clustering | copy erlang cookie
19 template:
20 src: erlang.cookie.j2
21 dest: "{{ rabbitmq_erlang_cookie_file }}"
22 owner: rabbitmq
23 group: rabbitmq
24 mode: 0400
25 backup: yes #backing up in case the need to recover
26# when: inventory_hostname != "{{ rabbitmq_master }}"
27
28- name: rabbitmq_clustering | restarting rabbitmq-server on master
29 service:
30 name: rabbitmq-server
31 state: restarted
32 when: inventory_hostname == "{{ rabbitmq_master }}"
33
34- name: rabbitmq_clustering | starting rabbitmq app on master
35 command: rabbitmqctl start_app
36 register: cluster_master
37 when: inventory_hostname == "{{ rabbitmq_master }}"
38
39- name: rabbitmq_clustering | sending sigterm to any running rabbitmq processes
40 shell: pkill -u rabbitmq || true
41 when: inventory_hostname != "{{ rabbitmq_master }}"
42
43- name: rabbitmq_clustering | restarting rabbitmq-server
44 service:
45 name: rabbitmq-server
46 state: restarted
47 when: inventory_hostname != "{{ rabbitmq_master }}"
48
49- name: rabbitmq_clustering | stopping rabbitmq app
50 command: rabbitmqctl stop_app
51 when: inventory_hostname != "{{ rabbitmq_master }}"
52
53- name: rabbitmq_clustering | resetting rabbitmq app
54 command: rabbitmqctl reset
55 when: inventory_hostname != "{{ rabbitmq_master }}"
56
57- name: rabbitmq_clustering | joining rabbitmq cluster
58 command: rabbitmqctl join_cluster 'rabbit@{{ rabbitmq_master }}'
59 register: cluster_joined
60 when: inventory_hostname != "{{ rabbitmq_master }}"
61
62- name: rabbitmq_clustering | starting rabbitmq app
63 command: rabbitmqctl start_app
64 when: inventory_hostname != "{{ rabbitmq_master }}"
65
66- name: rabbitmq_clustering | marking as clustered
67 file:
68 path: /etc/rabbitmq/clustered
69 state: touch
70 when: cluster_master.changed or cluster_joined.changed