refactored.
This commit is contained in:
parent
da070c862b
commit
4c329515f7
@ -6,23 +6,19 @@
|
|||||||
{{- '\n' -}}
|
{{- '\n' -}}
|
||||||
{%- elif data is string or data is number -%}
|
{%- elif data is string or data is number -%}
|
||||||
{{- data }}{{ '\n' -}}
|
{{- data }}{{ '\n' -}}
|
||||||
{%- elif data is mapping -%}
|
|
||||||
{%- if recurse > 0 -%}
|
|
||||||
{{- '{\n' -}}
|
|
||||||
{%- endif -%}
|
|
||||||
{%- for item in data|dictsort -%}
|
|
||||||
{{- item[key] }} {{ keepalived_config(item[value], recurse) -}}
|
|
||||||
{%- endfor -%}
|
|
||||||
{%- if recurse > 0 -%}
|
|
||||||
{{- '}\n' -}}
|
|
||||||
{%- endif -%}
|
|
||||||
{%- else -%}
|
{%- else -%}
|
||||||
{%- if recurse > 0 -%}
|
{%- if recurse > 0 -%}
|
||||||
{{- '{\n' -}}
|
{{- '{\n' -}}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
{%- for item in data -%}
|
{%- if data is mapping -%}
|
||||||
{{- keepalived_config(item) -}}
|
{%- for item in data|dictsort -%}
|
||||||
{%- endfor -%}
|
{{- item[key] }} {{ keepalived_config(item[value], recurse) -}}
|
||||||
|
{%- endfor -%}
|
||||||
|
{%- else -%}
|
||||||
|
{%- for item in data -%}
|
||||||
|
{{- keepalived_config(item) -}}
|
||||||
|
{%- endfor -%}
|
||||||
|
{%- endif -%}
|
||||||
{%- if recurse > 0 -%}
|
{%- if recurse > 0 -%}
|
||||||
{{- '}\n' -}}
|
{{- '}\n' -}}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
Loading…
Reference in New Issue
Block a user