diff --git a/templates/keepalived-checks.j2 b/templates/keepalived-checks.j2 index f6b61cb..b2ab777 100644 --- a/templates/keepalived-checks.j2 +++ b/templates/keepalived-checks.j2 @@ -2,7 +2,9 @@ {% if rserver.tcp_checks is defined %} {% for tcp_check in rserver.tcp_checks %} TCP_CHECK { + {% if tcp_check.connect_port is defined and tcp_check.connect_port %} connect_port {{ tcp_check.connect_port }} + {% endif %} connect_timeout {{ tcp_check.connect_timeout | default('5') }} {% if tcp_check.connect_ip is defined and tcp_check.connect_ip %} connect_ip {{ tcp_check.connect_ip }} diff --git a/templates/keepalived-virtual-server.j2 b/templates/keepalived-virtual-server.j2 index c13ddd6..16b2cb3 100644 --- a/templates/keepalived-virtual-server.j2 +++ b/templates/keepalived-virtual-server.j2 @@ -1,10 +1,15 @@ {# extra spaces are needed for backward compatibility #} - ip_family {{ vserver.ip_family | default('inet') }} + {% if vserver.ip_family is defined %} + ip_family {{ vserver.ip_family | default('inet', true) }} + {% endif %} {% if vserver.delay_loop is defined %} delay_loop {{ vserver.delay_loop }} {% endif %} lvs_sched {{ vserver.lvs_sched | default ('rr') }} lvs_method {{ vserver.lvs_method | default ('DR') }} + {% if vserver.persistence_timeout is defined %} + persistence_timeout {{ vserver.persistence_timeout }} + {% endif %} protocol {{ vserver.protocol | default ('TCP') }} {% if vserver.ha_suspend is defined and vserver.ha_suspend %} ha_suspend