From 2adb4ac87d75986e187dd1369fbaa30600f9820e Mon Sep 17 00:00:00 2001 From: Pat Riehecky Date: Fri, 2 Feb 2024 11:02:58 -0600 Subject: [PATCH] Try to fix ordering with ipsets --- lib/puppet/type/firewalld_zone.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/puppet/type/firewalld_zone.rb b/lib/puppet/type/firewalld_zone.rb index 2cc841ca..af114cce 100644 --- a/lib/puppet/type/firewalld_zone.rb +++ b/lib/puppet/type/firewalld_zone.rb @@ -8,6 +8,7 @@ # Puppet::Type.type(:firewalld_rich_rule) Puppet::Type.type(:firewalld_service) + Puppet::Type.type(:firewalld_ipset) Puppet::Type.type(:firewalld_port) desc <<-DOC @@ -211,6 +212,17 @@ def retrieve ['firewalld'] end + autorequire(:firewalld_ipset) do + ipsets = [] + if self[:sources] + (self[:sources]).each do |source| + ipsets.append(source.sub('ipset:', '')) if source.start_with?('ipset:') + end + end + + ipsets + end + def purge_resource(res_type) if Puppet.settings[:noop] || self[:noop] Puppet.debug "Would have purged #{res_type.ref}, (noop)"