From b7c6b42d5b24e6c4c9a0b4f198e8cf3d1b7f3fb6 Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Wed, 22 Apr 2020 16:36:32 +0300 Subject: [PATCH] Use defined keepalived track_scripts We define script inside keepalived_scripts, however have to override keepalived_instances once define another set of scripts, as track_scripts are hardcoded. We change this by dynamically set track_scripts with what we have in keepalived_scripts keys. Change-Id: I763ebba501f3e71009b6d3b2c011e7f069e47f5d --- inventory/group_vars/haproxy/keepalived.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/inventory/group_vars/haproxy/keepalived.yml b/inventory/group_vars/haproxy/keepalived.yml index 36dc49a7ba..74aa4c01cc 100644 --- a/inventory/group_vars/haproxy/keepalived.yml +++ b/inventory/group_vars/haproxy/keepalived.yml @@ -62,17 +62,13 @@ keepalived_instances: authentication_password: "{{ haproxy_keepalived_authentication_password }}" vips: - "{{ haproxy_keepalived_external_vip_cidr | default('169.254.1.1/24') }} dev {{ haproxy_keepalived_external_interface | default(management_bridge) }}" - track_scripts: - - haproxy_check_script - - pingable_check_script + track_scripts: "{{ keepalived_scripts.keys() }}" internal: interface: "{{ haproxy_keepalived_internal_interface | default(management_bridge) }}" state: "{{ (groups['haproxy'].index(inventory_hostname) == 0) | ternary('MASTER', 'BACKUP') }}" virtual_router_id: "{{ haproxy_keepalived_internal_virtual_router_id | default ('11') }}" priority: "{{ (groups['haproxy']|length-groups['haproxy'].index(inventory_hostname))*50 }}" authentication_password: "{{ haproxy_keepalived_authentication_password }}" - track_scripts: - - haproxy_check_script - - pingable_check_script + track_scripts: "{{ keepalived_scripts.keys() }}" vips: - "{{ haproxy_keepalived_internal_vip_cidr | default('169.254.2.1/24') }} dev {{ haproxy_keepalived_internal_interface | default(management_bridge) }}"