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
This commit is contained in:
Dmitriy Rabotjagov 2019-04-13 08:50:42 +03:00 committed by Dmitriy Rabotjagov
parent e4940799c7
commit 4f8a2ccb7b
3 changed files with 16 additions and 0 deletions

View File

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

View File

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

View File

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