18 lines
434 B
Django/Jinja
18 lines
434 B
Django/Jinja
{%- macro keepalived_config(data) -%}
|
|
{%- if data is none -%}
|
|
{{ '\n' }}
|
|
{%- elif data is mapping -%}
|
|
{%- for key, value in data.iteritems() -%}
|
|
{{ key }} {{ keepalived_config(value) }}
|
|
{%- endfor -%}
|
|
{%- elif data is string or data is number -%}
|
|
{{ data }}{{ '\n' }}
|
|
{%- else -%}
|
|
{{ '{\n' }}
|
|
{%- for value in data -%}
|
|
{{ keepalived_config(value) }}
|
|
{%- endfor -%}
|
|
{{ '}\n' }}
|
|
{%- endif -%}
|
|
{%- endmacro -%}
|