From d3f34e36b9fce715fed446de3cb7d9fbf98e857c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Fri, 3 Sep 2021 14:49:30 -1000 Subject: [PATCH] Fix `puppet resource openldap_access` The provider returned inconsistent entries, some of them having their `ensure` property set to `absent` and no `access` property. This fix this issue by using another format for the generated resource titles (to match what is done by the module when managing resources from Puppet code) and reworking the way an existing resource is detected. --- lib/puppet/provider/openldap_access/olc.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/puppet/provider/openldap_access/olc.rb b/lib/puppet/provider/openldap_access/olc.rb index b5f365f1..f4a66754 100644 --- a/lib/puppet/provider/openldap_access/olc.rb +++ b/lib/puppet/provider/openldap_access/olc.rb @@ -43,7 +43,7 @@ def self.instances false end i << new( - name: "{#{position}}to #{what} #{access.join(' ')} on #{suffix}", + name: "#{position} on #{suffix}", ensure: :present, position: position, what: what, @@ -108,9 +108,7 @@ def getDn(*args) end def exists? - resource[:suffix] == (@property_hash[:suffix]) && - resource[:access].flatten == @property_hash[:access].flatten && - resource[:what] == (@property_hash[:what]) + @property_hash[:ensure] == :present end def create