diff --git a/roles/ifstated/templates/ifstated-fsol.conf b/roles/ifstated/templates/ifstated-fsol.conf index 49aec85..e1a1bb0 100644 --- a/roles/ifstated/templates/ifstated-fsol.conf +++ b/roles/ifstated/templates/ifstated-fsol.conf @@ -1,6 +1,34 @@ init-state auto +if_carp_up="carp145.link.up" +if_carp_down="carp145.link.down" + state auto { - run "pfctl -f /etc/pf.conf" + if $if_carp_up { + set-state master + } + if $if_carp_down { + set-state backup + } +} + +state master { + init { + run "pfctl -f /etc/pf.conf" + run "route add 0/1 37.16.96.65" + } + if $if_carp_down { + set-state backup + } +} + +state backup { + init { + run "pfctl -f /etc/pf.conf" + run "route del 0/1" + } + if $if_carp_up { + set-state master + } }