diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index 00b74a0..744c54a 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -15,14 +15,18 @@ {%- if data is string or data is number -%} {{- " " }}{{ data }}{{ '\n' }} {%- else -%} + {%- if indents != 0 -%} {{- " {\n" -}} + {%- endif -%} {%- 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' }} + {%- if indents != 0 -%} +{{ '}'|indent(indents - 2, True) }}{{ '\n' }} + {%- endif -%} {%- endif -%} {%- endmacro -%}