Add keepalived_instances_overrides for customizing keepalived_instances

Change-Id: Ic6be7519aa869badda0a471fcf6ab11ebc5cbe87
This commit is contained in:
Danila Balagansky 2022-08-24 13:34:55 +03:00
parent 1736491007
commit 5422c2ac9a
2 changed files with 8 additions and 1 deletions

View File

@ -53,7 +53,7 @@ keepalived_scripts:
# priority: "{{ (groups['haproxy']|length-groups['haproxy'].index(inventory_hostname)*50 }}"
# by
# priority: "{{ (groups['haproxy'].index(inventory_hostname) == 0) | ternary('100','50') }}"
keepalived_instances:
_keepalived_default_instances:
external:
interface: "{{ haproxy_keepalived_external_interface | default(management_bridge) }}"
state: "{{ (groups['haproxy'].index(inventory_hostname) == 0) | ternary('MASTER', 'BACKUP') }}"
@ -72,3 +72,5 @@ keepalived_instances:
vips:
- "{{ haproxy_keepalived_internal_vip_cidr | default('169.254.2.1/24') }} dev {{ haproxy_keepalived_internal_interface | default(management_bridge) }}"
track_scripts: "{{ keepalived_scripts | dict2items | json_query('[*].{name: key, instance: value.instance}') | rejectattr('instance', 'equalto', 'external') | map(attribute='name') | list }}"
keepalived_instances: "{{ _keepalived_default_instances | combine(keepalived_instances_overrides | default({}), recursive=True) }}"

View File

@ -0,0 +1,5 @@
---
features:
- |
Add ``keepalived_instances_overrides`` variable, which allows passing
custom options for ``keepalived_instances``.