From f579e08e21122da9c7a840a5b7ab20cc84ba179c Mon Sep 17 00:00:00 2001 From: Jeltz Date: Fri, 13 Jan 2023 08:53:25 +0100 Subject: [PATCH] keepalived: change priorities --- roles/keepalived/defaults/main.yml | 1 + roles/keepalived/templates/keepalived.conf.j2 | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/roles/keepalived/defaults/main.yml b/roles/keepalived/defaults/main.yml index 4aeec8c..52c186a 100644 --- a/roles/keepalived/defaults/main.yml +++ b/roles/keepalived/defaults/main.yml @@ -4,5 +4,6 @@ keepalived__virtual_routes: {} keepalived__notify_master: [] keepalived__notify_backup: [] keepalived__notify_fault: [] +keepalived__main: false keepalived__max_auto_priority: -1 ... diff --git a/roles/keepalived/templates/keepalived.conf.j2 b/roles/keepalived/templates/keepalived.conf.j2 index dabd0e2..4df9973 100644 --- a/roles/keepalived/templates/keepalived.conf.j2 +++ b/roles/keepalived/templates/keepalived.conf.j2 @@ -44,7 +44,7 @@ vrrp_instance instance_v4 { virtual_router_id {{ keepalived__virtual_router_id | int }} interface {{ keepalived__interface }} state BACKUP - priority 250 + priority {{ keepalived__main | ternary(250, 150) }} nopreempt advert_int 1 accept @@ -79,7 +79,7 @@ vrrp_instance instance_v6 { virtual_router_id {{ keepalived__virtual_router_id | int }} interface {{ keepalived__interface }} state BACKUP - priority 250 + priority {{ keepalived__main | ternary(250, 150) }} nopreempt advert_int 1 accept