X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/cc045c868bf15083df4db4442c0d92814441951e..c36f915b13f088e99cbcd0d822e9fc32249fe713:/cookbooks/networking/templates/default/nftables.conf.erb diff --git a/cookbooks/networking/templates/default/nftables.conf.erb b/cookbooks/networking/templates/default/nftables.conf.erb index 63f45a0c8..7f0b1e17e 100644 --- a/cookbooks/networking/templates/default/nftables.conf.erb +++ b/cookbooks/networking/templates/default/nftables.conf.erb @@ -5,17 +5,19 @@ define external-interfaces = { <%= @interfaces.sort.uniq.join(", ") %> } define ip-private-addresses = { 10.0.0.0/8, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.0.2.0/24, 192.168.0.0/16 } define ip6-private-addresses = { 2001:db8::/32, fc00::/7 } -flush ruleset - table inet filter { set ip-osm-addresses { type ipv4_addr +<%- unless Array(@hosts["inet"]).empty? %> elements = { <%= Array(@hosts["inet"]).sort.join(", ") %> } +<%- end %> } set ip6-osm-addresses { type ipv6_addr +<%- unless Array(@hosts["inet"]).empty? %> elements = { <%= Array(@hosts["inet6"]).sort.join(", ") %> } +<%- end %> } set ip-blacklist {