ansible.nftables/templates/etc/nftables.d/nat-prerouting.nft.j2

22 lines
814 B
Plaintext
Raw Normal View History

#jinja2: lstrip_blocks: "True", trim_blocks: "True"
2019-04-16 15:48:30 +02:00
# {{ ansible_managed }}
{% set preroutingmerged = nft__nat_default_prerouting_rules.copy() %}
{% set _ = preroutingmerged.update(nft__nat_prerouting_rules) %}
{% set _ = preroutingmerged.update(nft__nat_group_prerouting_rules) %}
{% if nft_merged_groups and hostvars[inventory_hostname]['nft_combined_rules'].nft__nat_group_prerouting_rules is defined %}
{% set _ = preroutingmerged.update(hostvars[inventory_hostname]['nft_combined_rules'].nft__nat_group_prerouting_rules) %}
{% endif %}
2019-04-16 15:48:30 +02:00
{% set _ = preroutingmerged.update(nft__nat_host_prerouting_rules) %}
chain prerouting {
{% for group, rules in preroutingmerged|dictsort %}
# {{ group }}
{% if not rules %}
2019-04-16 15:48:30 +02:00
# (none)
{% endif %}
{% for rule in rules %}
2019-04-16 15:48:30 +02:00
{{ rule }}
{% endfor %}
2019-04-16 15:48:30 +02:00
{% endfor %}
}