diff options
author | Larry Smith Jr <larry.e.smith.jr@gmail.com> | 2015-08-09 09:52:29 -0400 |
---|---|---|
committer | Larry Smith Jr <larry.e.smith.jr@gmail.com> | 2015-08-09 09:52:29 -0400 |
commit | 10344646f028931e51befd890a19d24622f6486c (patch) | |
tree | 8dcd0900d78d636cce05864ffc8c2e2d77713d07 | |
parent | 69bbc13db1c9af839d5b9cacdf3546e89070fb91 (diff) | |
download | ansible-rabbitmq-10344646f028931e51befd890a19d24622f6486c.tar.gz ansible-rabbitmq-10344646f028931e51befd890a19d24622f6486c.tar.zst ansible-rabbitmq-10344646f028931e51befd890a19d24622f6486c.zip |
updated setting erlang cookie method
-rw-r--r-- | defaults/main.yml | 2 | ||||
-rw-r--r-- | tasks/rabbitmq_clustering.yml | 10 | ||||
-rw-r--r-- | templates/erlang.cookie.j2 | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/defaults/main.yml b/defaults/main.yml index 16191ff..e0f06a5 100644 --- a/defaults/main.yml +++ b/defaults/main.yml | |||
@@ -2,7 +2,7 @@ | |||
2 | # defaults file for ansible-rabbitmq | 2 | # defaults file for ansible-rabbitmq |
3 | config_rabbitmq_ha: false #defines if rabbitmq ha should be configured...define here or in group_vars/group | 3 | config_rabbitmq_ha: false #defines if rabbitmq ha should be configured...define here or in group_vars/group |
4 | enable_rabbitmq_clustering: false #defines if setting up a rabbitmq cluster...define here or in group_vars/group | 4 | enable_rabbitmq_clustering: false #defines if setting up a rabbitmq cluster...define here or in group_vars/group |
5 | #erlang_cookie: #define erlang cookie for cluster...define here or in group_vars/group | 5 | erlang_cookie: LSKNKBELKPSTDBBCHETL #define erlang cookie for cluster...define here or in group_vars/group |
6 | erlang_cookie_file: /var/lib/rabbitmq/.erlang.cookie | 6 | erlang_cookie_file: /var/lib/rabbitmq/.erlang.cookie |
7 | rabbitmq_config: | 7 | rabbitmq_config: |
8 | - queue_name: logstash | 8 | - queue_name: logstash |
diff --git a/tasks/rabbitmq_clustering.yml b/tasks/rabbitmq_clustering.yml index 4d8dd0d..348662a 100644 --- a/tasks/rabbitmq_clustering.yml +++ b/tasks/rabbitmq_clustering.yml | |||
@@ -8,14 +8,14 @@ | |||
8 | - name: rabbitmq_clustering | stopping rabbitmq-server | 8 | - name: rabbitmq_clustering | stopping rabbitmq-server |
9 | service: name=rabbitmq-server state=stopped | 9 | service: name=rabbitmq-server state=stopped |
10 | 10 | ||
11 | - name: grabbing erlang cookie | 11 | #- name: grabbing erlang cookie |
12 | shell: cat /var/lib/rabbitmq/.erlang.cookie | 12 | # shell: cat /var/lib/rabbitmq/.erlang.cookie |
13 | register: erlang_cookie | 13 | # register: erlang_cookie |
14 | when: inventory_hostname == "{{ rabbitmq_master }}" | 14 | # when: inventory_hostname == "{{ rabbitmq_master }}" |
15 | 15 | ||
16 | - name: rabbitmq_clustering | copy erlang cookie | 16 | - name: rabbitmq_clustering | copy erlang cookie |
17 | template: src=erlang.cookie.j2 dest={{ erlang_cookie_file }} owner=rabbitmq group=rabbitmq mode=0400 backup=yes | 17 | template: src=erlang.cookie.j2 dest={{ erlang_cookie_file }} owner=rabbitmq group=rabbitmq mode=0400 backup=yes |
18 | when: inventory_hostname != "{{ rabbitmq_master }}" | 18 | # when: inventory_hostname != "{{ rabbitmq_master }}" |
19 | 19 | ||
20 | - name: rabbitmq_clustering | restarting rabbitmq-server on master | 20 | - name: rabbitmq_clustering | restarting rabbitmq-server on master |
21 | service: name=rabbitmq-server state=restarted | 21 | service: name=rabbitmq-server state=restarted |
diff --git a/templates/erlang.cookie.j2 b/templates/erlang.cookie.j2 index 82b6c9a..cb398e7 100644 --- a/templates/erlang.cookie.j2 +++ b/templates/erlang.cookie.j2 | |||
@@ -1 +1 @@ | |||
{{ hostvars.rabbitmq_master.erlang_cookie.stdout }} | {{ erlang_cookie }} | ||