aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPaul Bonaud <paul.bonaud@fretlink.com>2018-12-17 19:02:27 +0100
committerPaul Bonaud <paul.bonaud@fretlink.com>2018-12-20 11:14:51 +0100
commit84d38251e016aebeb6fc72a5c76a486f0542212b (patch)
treec44422c628bf812d81361dac203150eb1282e8ec
parentd58696271f166b50faa2705fdda6337c1ffb493c (diff)
downloadansible-rabbitmq-84d38251e016aebeb6fc72a5c76a486f0542212b.tar.gz
ansible-rabbitmq-84d38251e016aebeb6fc72a5c76a486f0542212b.tar.zst
ansible-rabbitmq-84d38251e016aebeb6fc72a5c76a486f0542212b.zip
vhosts: Adding rabbitmq vhosts creation
-rw-r--r--defaults/main.yml5
-rw-r--r--tasks/main.yml3
-rw-r--r--tasks/rabbitmq_vhosts.yml7
3 files changed, 15 insertions, 0 deletions
diff --git a/defaults/main.yml b/defaults/main.yml
index f3d2c20..f7138a7 100644
--- a/defaults/main.yml
+++ b/defaults/main.yml
@@ -58,6 +58,11 @@ rabbitmq_redhat_package: "rabbitmq-server-{{ rabbitmq_redhat_version }}-1.noarch
58rabbitmq_redhat_url: "http://www.rabbitmq.com/releases/rabbitmq-server/v{{ rabbitmq_redhat_version }}" 58rabbitmq_redhat_url: "http://www.rabbitmq.com/releases/rabbitmq-server/v{{ rabbitmq_redhat_version }}"
59rabbitmq_redhat_version: 3.6.1 59rabbitmq_redhat_version: 3.6.1
60 60
61# Define extra vhosts to be created
62rabbitmq_extra_vhosts: []
63# - name: /
64# state: present
65
61# Define admin user to create in order to login to WebUI 66# Define admin user to create in order to login to WebUI
62rabbitmq_users: 67rabbitmq_users:
63 - name: rabbitmqadmin 68 - name: rabbitmqadmin
diff --git a/tasks/main.yml b/tasks/main.yml
index 1ef08f0..a9dc4d2 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -26,6 +26,9 @@
26 rabbitmq_enable_clustering and 26 rabbitmq_enable_clustering and
27 not clustered['stat']['exists'] 27 not clustered['stat']['exists']
28 28
29- include: rabbitmq_vhosts.yml
30 when: rabbitmq_extra_vhosts is defined
31
29- include: rabbitmq_ha_config.yml 32- include: rabbitmq_ha_config.yml
30 when: > 33 when: >
31 rabbitmq_config_ha and 34 rabbitmq_config_ha and
diff --git a/tasks/rabbitmq_vhosts.yml b/tasks/rabbitmq_vhosts.yml
new file mode 100644
index 0000000..790ac18
--- /dev/null
+++ b/tasks/rabbitmq_vhosts.yml
@@ -0,0 +1,7 @@
1---
2- name: Create vhosts
3 rabbitmq_vhost:
4 name: "{{ item['name'] }}"
5 state: "{{ item['state'] }}"
6 with_items: "{{ rabbitmq_extra_vhosts }}"
7 run_once: "{{ rabbitmq_enable_clustering is defined and rabbitmq_enable_clustering }}"