diff --git a/lib/puppet/type/firewalld_zone.rb b/lib/puppet/type/firewalld_zone.rb index 2cc841c..af114cc 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)"