From 4e0e6ac6acb8e70b02f60ade51772b41b0b607e1 Mon Sep 17 00:00:00 2001 From: Alexander Ivanes Date: Thu, 4 Apr 2024 18:54:44 +0300 Subject: [PATCH] Single element ipset array should be in sync with a string value --- lib/puppet/provider/firewall/firewall.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/puppet/provider/firewall/firewall.rb b/lib/puppet/provider/firewall/firewall.rb index dc41b3eb7..6ed526fa8 100644 --- a/lib/puppet/provider/firewall/firewall.rb +++ b/lib/puppet/provider/firewall/firewall.rb @@ -444,6 +444,12 @@ def insync?(context, _name, property_name, is_hash, should_hash) should = should_hash[property_name].to_s.gsub(%r{\s+}, '') is == should + when :ipset + is = is_hash[property_name] + is = [is] if is.is_a?(String) + should = should_hash[property_name] + should = [should] if should.is_a?(String) + is.sort == should.sort else # Ensure that if both values are arrays, that they are sorted prior to comparison return nil unless is_hash[property_name].is_a?(Array) && should_hash[property_name].is_a?(Array)