2017-01-19 01:51:16 +01:00
|
|
|
{%- macro keepalived_config(data) -%}
|
|
|
|
{%- if data is none -%}
|
|
|
|
{{ '\n' }}
|
|
|
|
{%- elif data is mapping -%}
|
|
|
|
{%- for key, value in data.iteritems() -%}
|
|
|
|
{{ key }} {{ keepalived_config(value) }}
|
|
|
|
{%- endfor -%}
|
2017-01-19 02:06:48 +01:00
|
|
|
{%- elif data is string or data is number -%}
|
2017-01-19 01:51:16 +01:00
|
|
|
{{ data }}{{ '\n' }}
|
2017-01-19 02:06:48 +01:00
|
|
|
{%- else -%}
|
|
|
|
{{ '{\n' }}
|
|
|
|
{%- for value in data -%}
|
|
|
|
{{ keepalived_config(value) }}
|
|
|
|
{%- endfor -%}
|
|
|
|
{{ '}\n' }}
|
2017-01-19 01:51:16 +01:00
|
|
|
{%- endif -%}
|
|
|
|
{%- endmacro -%}
|