19 lines
794 B
Django/Jinja
19 lines
794 B
Django/Jinja
{% macro controls(controls) %}
|
|
controls {
|
|
{% filter indent(2, true) %}
|
|
{% for control in controls %}
|
|
{% if control.type == "inet" %}
|
|
{{ ('inet ' + control.address) -}}
|
|
{{ (' port ' + control.port | string) if control.port is defined and control.port -}}
|
|
{{ (' allow {\n' + functions.simple_item_list(control.allow) + ' }') -}}
|
|
{% elif control.type == "unix" %}
|
|
{{ ('unix "' + control.path +'"') -}}
|
|
{{ ('perm ' + control.perm | string) -}}
|
|
{{ ('owner ' + control.owner | string) -}}
|
|
{{ ('group ' + control.group | string) -}}
|
|
{% endif %}
|
|
{{ (' keys {\n' + functions.simple_item_list(control.keynames) + '}') if control.keynames is defined and control.keynames -}}
|
|
{{ (' read-only ' + control.read_only | string) if control.read_only is defined -}};
|
|
{% endfor %}};
|
|
{% endfilter %}
|
|
{% endmacro %} |