Refactored.

This commit is contained in:
Jeff Baskin 2017-01-21 00:59:22 -05:00
parent 2f8ff3ec6b
commit 2c97cd79c9

View File

@ -14,15 +14,14 @@
{%- set indent = indent + 2 -%} {%- set indent = indent + 2 -%}
{%- endif -%} {%- endif -%}
{%- if data is mapping -%} {%- if data is mapping -%}
{%- set indentHolder = indent -%}
{%- for item in data|dictsort -%} {%- for item in data|dictsort -%}
{%- if item[key] in carryovers -%} {%- if item[key] in carryovers -%}
{{- keepalived_config(item[value], carryover=item[key], indent=indent) -}} {{- keepalived_config(item[value], carryover=item[key], indent=indent) -}}
{%- else -%} {%- else -%}
{%- set carryIndent = indentHolder -%} {%- set carryIndent = indent -%}
{%- set forwardIndent = indentHolder -%} {%- set forwardIndent = indent -%}
{%- if carryover -%} {%- if carryover -%}
{{- carryover|indent(indentHolder, True) }}{{ ' ' -}} {{- carryover|indent(indent, True) }}{{ ' ' -}}
{%- set carryIndent = 0 -%} {%- set carryIndent = 0 -%}
{%- endif -%} {%- endif -%}
{%- if item[value] is string or item[value] is not iterable -%} {%- if item[value] is string or item[value] is not iterable -%}