diff --git a/templates/etc/keepalived/keepalived.conf.j2 b/templates/etc/keepalived/keepalived.conf.j2 index 66e89a7..c58e137 100644 --- a/templates/etc/keepalived/keepalived.conf.j2 +++ b/templates/etc/keepalived/keepalived.conf.j2 @@ -102,9 +102,9 @@ vrrp_instance {{ key }} { {% endfor %} } -{% if value.virtual_routes %} +{% if value.virtual_routes is defined %} virtual_routes { -{% for virtual_route in value.virtual_routes %} +{% for virtual_route in value.virtual_routes | default([]) %} {{ virtual_route }} {% endfor %} }