keepalived-formula/keepalived/templates/config.jinja
2017-01-18 20:06:48 -05:00

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 -%}