|
9 | 9 | <rule family="{{ rule.family }}">
|
10 | 10 | {%- else %}
|
11 | 11 | <rule>
|
12 |
| - {%- endif %} |
| 12 | + {%- endif %} |
13 | 13 | {%- if 'ipset' in rule %}
|
14 | 14 | <source ipset="{{ rule.ipset.name }}" />
|
15 | 15 | {%- endif %}
|
16 | 16 | {%- if 'source' in rule %}
|
17 | 17 | <source address="{{ rule.source.address }}" {%- if 'invert' in rule.source %}invert="{{ rule.source.invert }}"{%- endif %} />
|
18 |
| - {%- endif %} |
| 18 | + {%- endif %} |
19 | 19 | {%- if 'destination' in rule %}
|
20 | 20 | <destination address="{{ rule.destination.address }}" {%- if 'invert' in rule.destination %}invert="{{ rule.destination.invert }}"{%- endif %} />
|
21 |
| - {%- endif %} |
| 21 | + {%- endif %} |
22 | 22 | {%- if 'service' in rule %}
|
23 | 23 | <service name="{{ rule.service }}" />
|
24 |
| - {%- endif %} |
| 24 | + {%- endif %} |
25 | 25 | {%- if 'port' in rule %}
|
26 | 26 | <port port="{{ rule.port.portid }}" protocol="{{ rule.port.protocol }}" />
|
27 |
| - {%- endif %} |
| 27 | + {%- endif %} |
28 | 28 | {%- if 'protocol' in rule %}
|
29 | 29 | <protocol value="{{ rule.protocol }}" />
|
30 |
| - {%- endif %} |
| 30 | + {%- endif %} |
31 | 31 | {%- if 'icmp_block' in rule %}
|
32 | 32 | <icmp-block name="{{ rule.icmp_block }}" />
|
33 |
| - {%- endif %} |
| 33 | + {%- endif %} |
34 | 34 | {%- if 'icmp_type' in rule %}
|
35 | 35 | <icmp-type name="{{ rule.icmp_type }}" />
|
36 |
| - {%- endif %} |
| 36 | + {%- endif %} |
37 | 37 | {%- if 'masquerade' in rule %}
|
38 | 38 | {%- if rule.masquerade %}<masquerade/>{%- endif %}
|
39 |
| - {%- endif %} |
| 39 | + {%- endif %} |
40 | 40 | {%- if 'forward_port' in rule %}
|
41 | 41 | {%- if 'comment' in rule.forward_port %}
|
42 | 42 | <!-- {{ rule.forward_port.comment }} -->
|
43 | 43 | {%- endif %}
|
44 | 44 | <forward-port port="{{ rule.forward_port.portid }}" protocol="{{ rule.forward_port.protocol }}"{%- if 'to_port' in rule.forward_port %} to-port="{{ rule.forward_port.to_port }}"{%- endif %}{%- if 'to_addr' in rule.forward_port %} to-addr="{{ rule.forward_port.to_addr }}"{%- endif %} />
|
45 |
| - {%- endif %} |
| 45 | + {%- endif %} |
46 | 46 | {%- if 'source_port' in rule %}
|
47 | 47 | {%- if 'comment' in rule.source_port %}
|
48 | 48 | <!-- {{ rule.source_port.comment }} -->
|
49 | 49 | {%- endif %}
|
50 | 50 | <source-port port="{{ rule.source_port.portid }}" protocol="{{ rule.source_port.protocol }}"{%- if 'to_port' in rule.source_port %} to-port="{{ rule.source_port.to_port }}"{%- endif %}{%- if 'to_addr' in rule.source_port %} to-addr="{{ rule.source_port.to_addr }}"{%- endif %} />
|
51 |
| - {%- endif %} |
| 51 | + {%- endif %} |
52 | 52 | {%- if 'log' in rule %}
|
53 | 53 | <log{%- if 'prefix' in rule.log %} prefix="{{ rule.log.prefix }}"{%- endif %}{%- if 'level' in rule.log %} level="{{ rule.log.level }}"{%- endif %}>
|
54 | 54 | {%- if 'limit' in rule.log %}
|
55 | 55 | <limit value="{{ rule.log.limit }}"/>
|
56 | 56 | {%- endif %}
|
57 | 57 | </log>
|
58 |
| - {%- endif %} |
| 58 | + {%- endif %} |
59 | 59 | {%- if 'audit' in rule %}
|
60 | 60 | <audit>{%- if 'limit' in rule.audit %} <limit value="{{ rule.audit.limit }}"/>{%- endif %}</audit>
|
61 |
| - {%- endif %} |
| 61 | + {%- endif %} |
62 | 62 | {%- if 'accept' in rule %}
|
63 | 63 | <accept/>
|
64 | 64 | {%- endif %}
|
65 | 65 | {%- if 'reject' in rule %}
|
66 | 66 | <reject{%- if 'type' in rule.reject %} type="{{ rule.reject.type }}"{%- endif %} />
|
67 |
| - {%- endif %} |
| 67 | + {%- endif %} |
68 | 68 | {%- if 'drop' in rule %}
|
69 | 69 | <drop/>
|
70 |
| - {%- endif %} |
| 70 | + {%- endif %} |
71 | 71 | </rule>
|
72 | 72 | {%- endmacro %}
|
73 | 73 | <zone{%- if 'target' in zone %} target="{{ zone.target }}"{%- endif %}>
|
|
0 commit comments