29 lines
651 B
Django/Jinja
Executable File
29 lines
651 B
Django/Jinja
Executable File
#!/usr/sbin/nft -f
|
|
# {{ ansible_managed }}
|
|
{% set globalmerged = nft_global_default_rules.copy() %}
|
|
{% set _ = globalmerged.update(nft_global_rules) %}
|
|
{% set _ = globalmerged.update(nft_global_group_rules) %}
|
|
{% set _ = globalmerged.update(nft_global_host_rules) %}
|
|
|
|
# clean
|
|
flush ruleset
|
|
|
|
include "/etc/nftables.d/defines.nft"
|
|
|
|
table inet filter {
|
|
chain global {
|
|
{% for group, rules in globalmerged|dictsort %}
|
|
# {{ group }}
|
|
{% if not rules %}
|
|
# (none)
|
|
{% endif %}
|
|
{% for rule in rules %}
|
|
{{ rule }}
|
|
{% endfor %}
|
|
{% endfor %}
|
|
}
|
|
include "{{ nft_set_conf_path }}"
|
|
include "{{ nft_input_conf_path }}"
|
|
include "{{ nft_output_conf_path }}"
|
|
}
|