xoxys.firewalld/templates/etc/firewalld/services/service.xml.j2

22 lines
723 B
Plaintext
Raw Normal View History

2022-06-13 20:18:21 +00:00
#jinja2: lstrip_blocks: True
<?xml version="1.0" encoding="utf-8"?>
<service>
{% if item.short is defined %}
<short>{{ item.short }}</short>
{% endif %}
{% if item.description is defined %}
<description>{{ item.description }}</description>
{% endif %}
{% for tag in item %}
{# Tags which can be used several times #}
{% if tag in ["port", "protocol", "source-port", "module"] %}
{% for subtag in item[tag] %}
<{{ tag }}{% for name, value in subtag.items() %} {{ name }}="{{ value }}"{% endfor %}/>
{% endfor %}
{# Tags which can be used once #}
{% elif tag in ["destination"] %}
<{{ tag }}{% for name, value in tag.items() | default({}) %} {{ name }}="{{ value }}"{% endfor %}/>
{% endif %}
{% endfor %}
</service>