diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index 0b0e2a6..44a2fcc 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -14,12 +14,15 @@ {%- macro config_entries(data, indents) -%} {%- if data is string or data is number -%} {{- " " }}{{ data }} - {%- elif data is mapping -%} - {%- for entry in data|dictsort -%} -{{ entry[0]|indent(indents, True) }} { + {%- else -%} +{{- " {" -}} + {%- if data is mapping -%} + {%- for entry in data|dictsort -%} +{{ entry[0]|indent(indents, True) }} {{- config_entries(entry[1], indents + 2) -}} + {%- endfor -%} + {%- endif -%} {{ '}'|indent(indents, True) }}{{ '\n' }} - {%- endfor -%} {%- endif -%} {%- endmacro -%}