From 0025ab7a2fd01f77985d6f77d8dc13571ea88623 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Fri, 29 Aug 2025 16:29:22 +0100 Subject: [PATCH] Fix nftables shutdown if set not defined --- cookbooks/networking/templates/default/nftables.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cookbooks/networking/templates/default/nftables.erb b/cookbooks/networking/templates/default/nftables.erb index c8d9c1ac0..677958659 100644 --- a/cookbooks/networking/templates/default/nftables.erb +++ b/cookbooks/networking/templates/default/nftables.erb @@ -12,8 +12,8 @@ start() { } stop() { - /usr/sbin/nft list set inet chef-filter ip-blocklist > /var/lib/nftables/ip-blocklist.nft - /usr/sbin/nft list set inet chef-filter ip6-blocklist > /var/lib/nftables/ip6-blocklist.nft + /usr/sbin/nft list set inet chef-filter ip-blocklist > /var/lib/nftables/ip-blocklist.nft || true + /usr/sbin/nft list set inet chef-filter ip6-blocklist > /var/lib/nftables/ip6-blocklist.nft || true /usr/sbin/nft delete table inet chef-filter <% if node[:roles].include?("gateway") -%> /usr/sbin/nft delete table ip chef-nat -- 2.39.5