Skip to content

Commit a5d085b

Browse files
authored
Merge pull request #363 from jcpunk/ipset-ordering
Try to fix ordering with ipsets
2 parents 302c22c + 2adb4ac commit a5d085b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/puppet/type/firewalld_zone.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#
99
Puppet::Type.type(:firewalld_rich_rule)
1010
Puppet::Type.type(:firewalld_service)
11+
Puppet::Type.type(:firewalld_ipset)
1112
Puppet::Type.type(:firewalld_port)
1213

1314
desc <<-DOC
@@ -211,6 +212,17 @@ def retrieve
211212
['firewalld']
212213
end
213214

215+
autorequire(:firewalld_ipset) do
216+
ipsets = []
217+
if self[:sources]
218+
(self[:sources]).each do |source|
219+
ipsets.append(source.sub('ipset:', '')) if source.start_with?('ipset:')
220+
end
221+
end
222+
223+
ipsets
224+
end
225+
214226
def purge_resource(res_type)
215227
if Puppet.settings[:noop] || self[:noop]
216228
Puppet.debug "Would have purged #{res_type.ref}, (noop)"

0 commit comments

Comments
 (0)