diff --git a/keepalived/templates/keepalived.jinja b/keepalived/templates/keepalived.jinja index bf582fd..a9e216f 100644 --- a/keepalived/templates/keepalived.jinja +++ b/keepalived/templates/keepalived.jinja @@ -11,14 +11,14 @@ default=keepalived_defaults, merge=True) %} -{%- macro config_entries(data) -%} +{%- macro config_entries(data, indents) -%} {%- if data is mapping -%} {%- for entry in data|dictsort -%} -{{ entry[0] }} { -{{ config_entries(entry[1]) }} +{{ entry[0]|indent(indents, True) }} { +{{ config_entries(entry[1], indents + 2) }} }{{ '\n' }} {%- endfor -%} {%- endif -%} {%- endmacro -%} -{{ config_entries(keepalived_final_values) }} +{{ config_entries(keepalived_final_values, 0) }}