2020-11-10 21:17:11 +01:00
|
|
|
#jinja2: lstrip_blocks: "True", trim_blocks: "True"
|
2019-04-16 15:48:30 +02:00
|
|
|
# {{ ansible_managed }}
|
|
|
|
{% set postroutingmerged = nft__nat_default_postrouting_rules.copy() %}
|
|
|
|
{% set _ = postroutingmerged.update(nft__nat_postrouting_rules) %}
|
|
|
|
{% set _ = postroutingmerged.update(nft__nat_group_postrouting_rules) %}
|
2020-11-10 21:17:11 +01:00
|
|
|
{% if merged_groups and hostvars[inventory_hostname]['nft_combined_rules'].nft__nat_group_postrouting_rules is defined %}
|
|
|
|
{% set _ = postroutingmerged.update(hostvars[inventory_hostname]['nft_combined_rules'].nft__nat_group_postrouting_rules) %}
|
|
|
|
{% endif %}
|
2019-04-16 15:48:30 +02:00
|
|
|
{% set _ = postroutingmerged.update(nft__nat_host_postrouting_rules) %}
|
|
|
|
|
|
|
|
chain postrouting {
|
|
|
|
{% for group, rules in postroutingmerged|dictsort %}
|
|
|
|
# {{ group }}
|
2020-11-10 21:17:11 +01:00
|
|
|
{% if not rules %}
|
2019-04-16 15:48:30 +02:00
|
|
|
# (none)
|
2020-11-10 21:17:11 +01:00
|
|
|
{% endif %}
|
|
|
|
{% for rule in rules %}
|
2019-04-16 15:48:30 +02:00
|
|
|
{{ rule }}
|
2020-11-10 21:17:11 +01:00
|
|
|
{% endfor %}
|
2019-04-16 15:48:30 +02:00
|
|
|
{% endfor %}
|
|
|
|
}
|