Browse Source

Add global HA policy for rabbitmq

This patch adds 2 new variables into group_vars: oslomsg_notify_policies
and oslomsg_rpc_policies. These variables contain default rabbitmq
policies, which will be applied for every vhost.
As for now they contain only 1 policy, which enables HA mode[0].

[0] - https://www.rabbitmq.com/ha.html

Change-Id: I6857b2f8ccab169a2317b1de4cc106404534e3e4
Dmitriy Rabotjagov 1 week ago
parent
commit
4f8a2ccb7b

+ 5
- 0
inventory/group_vars/all/infra.yml View File

@@ -24,6 +24,11 @@ rabbitmq_servers: >-
24 24
       | map('extract', hostvars, 'ansible_host')
25 25
       | list | join(',')
26 26
   }}
27
+rabbitmq_policies:
28
+  - name: "HA"
29
+    pattern: '^(?!(amq\.)|(.*_fanout_)|(reply_)).*'
30
+    priority: 0
31
+    tags: "ha-mode=all"
27 32
 
28 33
 ## Galera options
29 34
 galera_client_package_state: "{{ package_state }}"

+ 2
- 0
inventory/group_vars/all/oslo-messaging.yml View File

@@ -19,6 +19,7 @@ oslomsg_rpc_port: "{{ (groups[qdrouterd_host_group] | length > 0) | ternary(qdro
19 19
 oslomsg_rpc_servers: "{{ (groups[qdrouterd_host_group] | length > 0) | ternary(qdrouterd_servers, rabbitmq_servers) }}"
20 20
 oslomsg_rpc_use_ssl: "{{ (groups[qdrouterd_host_group] | length > 0) | ternary(qdrouterd_use_ssl, rabbitmq_use_ssl) }}"
21 21
 oslomsg_rpc_host_group: "{{ (groups[qdrouterd_host_group] | length > 0) | ternary(qdrouterd_host_group, rabbitmq_host_group) }}"
22
+oslomsg_rpc_policies: "{{ rabbitmq_policies }}"
22 23
 
23 24
 # Notify
24 25
 oslomsg_notify_transport: "{{ (groups[rabbitmq_host_group] | length > 0) | ternary('rabbit', 'none') }}"
@@ -26,3 +27,4 @@ oslomsg_notify_port: "{{ rabbitmq_port }}"
26 27
 oslomsg_notify_servers: "{{ rabbitmq_servers }}"
27 28
 oslomsg_notify_use_ssl: "{{ rabbitmq_use_ssl }}"
28 29
 oslomsg_notify_host_group: "{{ rabbitmq_host_group }}"
30
+oslomsg_notify_policies: "{{ rabbitmq_policies }}"

+ 9
- 0
releasenotes/notes/oslomsg_policies-7ac27a5c2a7fbed2.yaml View File

@@ -0,0 +1,9 @@
1
+---
2
+features:
3
+  - |
4
+    Added 2 new varibles for all groups - `oslomsg_notify_policies` and
5
+    `oslomsg_rpc_policies`. These variables contain default rabbitmq
6
+    policies, which will be applied for every rabbitmq vhost. As for now they
7
+    will enable [HA mode](https://www.rabbitmq.com/ha.html) for all vhosts.
8
+    If you would like to disable HA mode just set these variables to empty
9
+    lists inside your `user_config.yml`

Loading…
Cancel
Save