diff --git a/net/keepalived/files/keepalived.init b/net/keepalived/files/keepalived.init index da5b69c4a..125c08721 100644 --- a/net/keepalived/files/keepalived.init +++ b/net/keepalived/files/keepalived.init @@ -248,6 +248,24 @@ vrrp_instance() { config_section_open "vrrp_instance" "$name" + config_get auth_type $1 auth_type + config_get auth_pass $1 auth_pass + [ -n "$auth_type" -a -n "$auth_pass" ] && { + printf "${INDENT_1}authentication {\n" >> $KEEPALIVED_CONF + printf "${INDENT_2}auth_type $auth_type\n" >> $KEEPALIVED_CONF + printf "${INDENT_2}auth_pass $auth_pass\n" >> $KEEPALIVED_CONF + printf "$INDENT_1}\n" >> $KEEPALIVED_CONF + } + + print_elems_indent $1 $INDENT_1 use_vmac state interface \ + mcast_src_ip unicast_src_ip virtual_router_id version priority \ + advert_int preempt_delay debug notify_backup \ + notify_master notify_fault notify_stop notify \ + lvs_sync_daemon_interface garp_master_delay garp_master_refresh \ + garp_master_repeat garp_master_refresh_repeat \ + no_val_vmac_xmit_base no_val_native_ipv6 no_val_accept \ + no_val_dont_track_primary no_val_smtp_alert no_val_nopreempt + # Handle virtual_ipaddress & virtual_ipaddress_excluded lists for opt in virtual_ipaddress virtual_ipaddress_excluded; do config_get $opt $1 $opt @@ -291,24 +309,6 @@ vrrp_instance() { done unset optval - config_get auth_type $1 auth_type - config_get auth_pass $1 auth_pass - [ -n "$auth_type" -a -n "$auth_pass" ] && { - printf "${INDENT_1}authentication {\n" >> $KEEPALIVED_CONF - printf "${INDENT_2}auth_type $auth_type\n" >> $KEEPALIVED_CONF - printf "${INDENT_2}auth_pass $auth_pass\n" >> $KEEPALIVED_CONF - printf "$INDENT_1}\n" >> $KEEPALIVED_CONF - } - - print_elems_indent $1 $INDENT_1 use_vmac state interface \ - mcast_src_ip unicast_src_ip virtual_router_id version priority \ - advert_int preempt_delay debug notify_backup \ - notify_master notify_fault notify_stop notify \ - lvs_sync_daemon_interface garp_master_delay garp_master_refresh \ - garp_master_repeat garp_master_refresh_repeat \ - no_val_vmac_xmit_base no_val_native_ipv6 no_val_accept \ - no_val_dont_track_primary no_val_smtp_alert no_val_nopreempt - config_section_close }