Hi.
Sorry for bad English.
If used not all VRRP-transition scripts (master, backup,fault), or if used only one script (eg. master) - it will be executed only one time, for one VRRP-transition.
This is because in keepalived.conf is formed notify property with "vrrp-script-wrapper.py" for each situation (master, backup, fault).
But "vrrp-script-wrapper.py" save state for each VRRP-group and do not execute script if state no changed.
old_state = vyos.keepalived.get_old_state(args.group) if (old_state is None) or (old_state != args.state): <exec script> else: syslog.syslog(syslog.LOG_NOTICE, "State of the group {0} has not changed, not running transition script".format(args.group))
If i have only master script - it will be executed once, for one transition to MASTER, because state is None.
After this new state "master" is saved and script execution code is unaccesible for next-time Master transition.
Nothing else "vrrp-script-wrapper.py" change this saved state.
vyos.keepalived.save_state(args.group, args.state)
I dont understand, why do you need a condition here.
Keepalived will execute each notify-script only if state changed.