aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLarry Smith Jr <mrlesmithjr@gmail.com>2016-12-03 16:41:53 -0500
committerLarry Smith Jr <mrlesmithjr@gmail.com>2016-12-03 16:41:53 -0500
commitda8e343df912e94703a8094f5e62d4c1bcc57345 (patch)
tree5ba5cbbff9050e22580961eaeefbe1a4dcd3c82b
parent6b75df2e01f267bf7153baa310d794b7e9bae143 (diff)
downloadansible-rabbitmq-da8e343df912e94703a8094f5e62d4c1bcc57345.tar.gz
ansible-rabbitmq-da8e343df912e94703a8094f5e62d4c1bcc57345.tar.zst
ansible-rabbitmq-da8e343df912e94703a8094f5e62d4c1bcc57345.zip
Addressed issue #5
Signed-off-by: Larry Smith Jr <mrlesmithjr@gmail.com>
-rw-r--r--README.md16
-rw-r--r--defaults/main.yml20
-rw-r--r--playbook.yml4
-rw-r--r--tasks/main.yml4
-rw-r--r--tasks/rabbitmq_clustering.yml4
-rw-r--r--tasks/rabbitmq_users.yml4
-rw-r--r--templates/erlang.cookie.j22
7 files changed, 27 insertions, 27 deletions
diff --git a/README.md b/README.md
index 8685452..03cd1aa 100644
--- a/README.md
+++ b/README.md
@@ -31,10 +31,10 @@ Role Variables
31```` 31````
32--- 32---
33# defaults file for ansible-rabbitmq 33# defaults file for ansible-rabbitmq
34config_rabbitmq_ha: false #defines if rabbitmq ha should be configured...define here or in group_vars/group 34rabbitmq_config_ha: false #defines if rabbitmq ha should be configured...define here or in group_vars/group
35enable_rabbitmq_clustering: false #defines if setting up a rabbitmq cluster...define here or in group_vars/group 35rabbitmq_enable_clustering: false #defines if setting up a rabbitmq cluster...define here or in group_vars/group
36erlang_cookie: 'LSKNKBELKPSTDBBCHETL' #define erlang cookie for cluster...define here or in group_vars/group 36rabbitmq_erlang_cookie: 'LSKNKBELKPSTDBBCHETL' #define erlang cookie for cluster...define here or in group_vars/group
37erlang_cookie_file: '/var/lib/rabbitmq/.erlang.cookie' 37rabbitmq_erlang_cookie_file: '/var/lib/rabbitmq/.erlang.cookie'
38rabbitmq_config: 38rabbitmq_config:
39 - queue_name: logstash 39 - queue_name: logstash
40 durable: true 40 durable: true
@@ -63,8 +63,8 @@ example...
63group_vars/rabbitmq-cluster-nodes 63group_vars/rabbitmq-cluster-nodes
64```` 64````
65--- 65---
66enable_rabbitmq_clustering: true 66rabbitmq_enable_clustering: true
67config_rabbitmq_ha: false 67rabbitmq_config_ha: false
68rabbitmq_master: ans-test-1 68rabbitmq_master: ans-test-1
69```` 69````
70 70
@@ -95,8 +95,8 @@ Example Playbook
95- hosts: all 95- hosts: all
96 become: true 96 become: true
97 vars: 97 vars:
98 - config_rabbitmq_ha: true 98 - rabbitmq_config_ha: true
99 - enable_rabbitmq_clustering: true 99 - rabbitmq_enable_clustering: true
100 - pri_domain_name: 'test.vagrant.local' 100 - pri_domain_name: 'test.vagrant.local'
101 - rabbitmq_master: 'node0' 101 - rabbitmq_master: 'node0'
102 roles: 102 roles:
diff --git a/defaults/main.yml b/defaults/main.yml
index 4923974..ad22ead 100644
--- a/defaults/main.yml
+++ b/defaults/main.yml
@@ -1,27 +1,27 @@
1--- 1---
2# defaults file for ansible-rabbitmq 2# defaults file for ansible-rabbitmq
3config_rabbitmq_ha: false #defines if rabbitmq ha should be configured...define here or in group_vars/group
4enable_rabbitmq_clustering: false #defines if setting up a rabbitmq cluster...define here or in group_vars/group
5erlang_cookie: 'LSKNKBELKPSTDBBCHETL' #define erlang cookie for cluster...define here or in group_vars/group
6erlang_cookie_file: '/var/lib/rabbitmq/.erlang.cookie'
7rabbitmq_config: 3rabbitmq_config:
8 - queue_name: logstash 4 - queue_name: 'logstash'
9 durable: true 5 durable: true
10 exchange_name: logstash 6 exchange_name: logstash
11 type: direct 7 type: 'direct'
12 routing_key: logstash 8 routing_key: 'logstash'
13 tags: 'ha-mode=all,ha-sync-mode=automatic' 9 tags: 'ha-mode=all,ha-sync-mode=automatic'
10rabbitmq_config_ha: false #defines if rabbitmq ha should be configured...define here or in group_vars/group
14rabbitmq_debian_repo: 'deb http://www.rabbitmq.com/debian/ testing main' 11rabbitmq_debian_repo: 'deb http://www.rabbitmq.com/debian/ testing main'
15rabbitmq_debian_repo_key: 'https://www.rabbitmq.com/rabbitmq-release-signing-key.asc' 12rabbitmq_debian_repo_key: 'https://www.rabbitmq.com/rabbitmq-release-signing-key.asc'
13rabbitmq_enable_clustering: false #defines if setting up a rabbitmq cluster...define here or in group_vars/group
14rabbitmq_erlang_cookie: 'LSKNKBELKPSTDBBCHETL' #define erlang cookie for cluster...define here or in group_vars/group
15rabbitmq_erlang_cookie_file: '/var/lib/rabbitmq/.erlang.cookie'
16rabbitmq_master: [] #defines the inventory host that should be considered master...define here or in group_vars/group 16rabbitmq_master: [] #defines the inventory host that should be considered master...define here or in group_vars/group
17rabbitmq_redhat_repo_key: 'https://www.rabbitmq.com/rabbitmq-signing-key-public.asc' 17rabbitmq_redhat_repo_key: 'https://www.rabbitmq.com/rabbitmq-signing-key-public.asc'
18rabbitmq_redhat_package: 'rabbitmq-server-{{ rabbitmq_redhat_version }}-1.noarch.rpm' 18rabbitmq_redhat_package: 'rabbitmq-server-{{ rabbitmq_redhat_version }}-1.noarch.rpm'
19rabbitmq_redhat_url: 'http://www.rabbitmq.com/releases/rabbitmq-server/v{{ rabbitmq_redhat_version }}' 19rabbitmq_redhat_url: 'http://www.rabbitmq.com/releases/rabbitmq-server/v{{ rabbitmq_redhat_version }}'
20rabbitmq_redhat_version: '3.6.1' 20rabbitmq_redhat_version: '3.6.1'
21rabbitmq_users: #define admin user to create in order to login to WebUI 21rabbitmq_users: #define admin user to create in order to login to WebUI
22 - name: rabbitmqadmin 22 - name: 'rabbitmqadmin'
23 password: rabbitmqadmin 23 password: 'rabbitmqadmin'
24 vhost: / 24 vhost: '/'
25 configure_priv: '.*' 25 configure_priv: '.*'
26 read_priv: '.*' 26 read_priv: '.*'
27 write_priv: '.*' 27 write_priv: '.*'
diff --git a/playbook.yml b/playbook.yml
index a9a7bba..498c829 100644
--- a/playbook.yml
+++ b/playbook.yml
@@ -16,8 +16,8 @@
16- hosts: all 16- hosts: all
17 become: true 17 become: true
18 vars: 18 vars:
19 - config_rabbitmq_ha: true 19 - rabbitmq_config_ha: true
20 - enable_rabbitmq_clustering: true 20 - rabbitmq_enable_clustering: true
21 - pri_domain_name: 'test.vagrant.local' 21 - pri_domain_name: 'test.vagrant.local'
22 - rabbitmq_master: 'node0' 22 - rabbitmq_master: 'node0'
23 roles: 23 roles:
diff --git a/tasks/main.yml b/tasks/main.yml
index 26abc8d..bd82f93 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -13,9 +13,9 @@
13 register: clustered 13 register: clustered
14 14
15- include: rabbitmq_clustering.yml 15- include: rabbitmq_clustering.yml
16 when: enable_rabbitmq_clustering and (clustered.stat.exists != True) 16 when: rabbitmq_enable_clustering and (clustered.stat.exists != True)
17 17
18- include: rabbitmq_ha_config.yml 18- include: rabbitmq_ha_config.yml
19 when: config_rabbitmq_ha and enable_rabbitmq_clustering 19 when: rabbitmq_config_ha and rabbitmq_enable_clustering
20 20
21- include: rabbitmq_users.yml 21- include: rabbitmq_users.yml
diff --git a/tasks/rabbitmq_clustering.yml b/tasks/rabbitmq_clustering.yml
index f9b5157..9dece46 100644
--- a/tasks/rabbitmq_clustering.yml
+++ b/tasks/rabbitmq_clustering.yml
@@ -12,13 +12,13 @@
12 12
13#- name: grabbing erlang cookie 13#- name: grabbing erlang cookie
14# shell: cat /var/lib/rabbitmq/.erlang.cookie 14# shell: cat /var/lib/rabbitmq/.erlang.cookie
15# register: erlang_cookie 15# register: rabbitmq_erlang_cookie
16# when: inventory_hostname == "{{ rabbitmq_master }}" 16# when: inventory_hostname == "{{ rabbitmq_master }}"
17 17
18- name: rabbitmq_clustering | copy erlang cookie 18- name: rabbitmq_clustering | copy erlang cookie
19 template: 19 template:
20 src: erlang.cookie.j2 20 src: erlang.cookie.j2
21 dest: "{{ erlang_cookie_file }}" 21 dest: "{{ rabbitmq_erlang_cookie_file }}"
22 owner: rabbitmq 22 owner: rabbitmq
23 group: rabbitmq 23 group: rabbitmq
24 mode: 0400 24 mode: 0400
diff --git a/tasks/rabbitmq_users.yml b/tasks/rabbitmq_users.yml
index 3e1997a..8bce8b2 100644
--- a/tasks/rabbitmq_users.yml
+++ b/tasks/rabbitmq_users.yml
@@ -10,7 +10,7 @@
10 tags: "{{ item.tags }}" 10 tags: "{{ item.tags }}"
11 state: present 11 state: present
12 with_items: "{{ rabbitmq_users }}" 12 with_items: "{{ rabbitmq_users }}"
13 when: (enable_rabbitmq_clustering is defined and not enable_rabbitmq_clustering) or enable_rabbitmq_clustering is not defined 13 when: (rabbitmq_enable_clustering is defined and not rabbitmq_enable_clustering) or rabbitmq_enable_clustering is not defined
14 14
15- name: rabbitmq_users | creating rabbitmq users 15- name: rabbitmq_users | creating rabbitmq users
16 rabbitmq_user: 16 rabbitmq_user:
@@ -24,4 +24,4 @@
24 state: present 24 state: present
25 run_once: yes 25 run_once: yes
26 with_items: "{{ rabbitmq_users }}" 26 with_items: "{{ rabbitmq_users }}"
27 when: (enable_rabbitmq_clustering is defined and enable_rabbitmq_clustering) 27 when: (rabbitmq_enable_clustering is defined and rabbitmq_enable_clustering)
diff --git a/templates/erlang.cookie.j2 b/templates/erlang.cookie.j2
index cb398e7..edd141f 100644
--- a/templates/erlang.cookie.j2
+++ b/templates/erlang.cookie.j2
@@ -1 +1 @@
{{ erlang_cookie }} {{ rabbitmq_erlang_cookie }}