From 475937bb39c4983046a00f9b14a08b5475183080 Mon Sep 17 00:00:00 2001 From: Bogdan Iamandei Date: Tue, 20 Dec 2022 12:16:08 +1100 Subject: [PATCH 1/3] Fix wrong matching pattern for appserver namevar --- lib/puppet/type/websphere_shared_library.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/puppet/type/websphere_shared_library.rb b/lib/puppet/type/websphere_shared_library.rb index 227b2a9f..c1af65ec 100644 --- a/lib/puppet/type/websphere_shared_library.rb +++ b/lib/puppet/type/websphere_shared_library.rb @@ -92,7 +92,7 @@ def self.title_patterns ], # /opt/IBM/WebSphere/AppServer/profiles:PROFILE_DMGR_01:server:CELL_01:AppNode01:AppServer01:PuppetTest [ - %r{^(.*):(.*):(server):(.*):(.*):(.*)$}, + %r{^(.*):(.*):(server):(.*):(.*):(.*):(.*)$}, [ [:profile_base], [:dmgr_profile], From 2a0b64d7daf95890bde01a5fb12b4b148a47e173 Mon Sep 17 00:00:00 2001 From: Bogdan Iamandei Date: Tue, 20 Dec 2022 13:17:05 +1100 Subject: [PATCH 2/3] Use unsetAttributes() to enact changes to: * classPath * nativePath Otherwise - changes are appended, not replaced. --- lib/puppet/provider/websphere_shared_library/wsadmin.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/puppet/provider/websphere_shared_library/wsadmin.rb b/lib/puppet/provider/websphere_shared_library/wsadmin.rb index b0bbaeb9..0aa2a602 100644 --- a/lib/puppet/provider/websphere_shared_library/wsadmin.rb +++ b/lib/puppet/provider/websphere_shared_library/wsadmin.rb @@ -171,6 +171,11 @@ def flush return if @property_hash.empty? cmd = <<-EOS id = AdminConfig.getid(\"#{scope('query')}Library:#{resource[:name]}\") + +# The modify command appends the specified unique classPath or nativePath values to the existing values. +# To completely replace the values, we must first remove the path attributes using the unsetAttributes command. +AdminConfig.unsetAttributes(id, '["classPath" "nativePath"]') + AdminConfig.modify(id, #{modified_attributes_list_list}) AdminConfig.save() EOS From 708d5cf1838ef4ac414222ae84d1557d1e97ee69 Mon Sep 17 00:00:00 2001 From: Bogdan Iamandei Date: Tue, 20 Dec 2022 14:48:32 +1100 Subject: [PATCH 3/3] Undo the node matching namevar fix as this was fixed in a different branch. --- lib/puppet/type/websphere_shared_library.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/puppet/type/websphere_shared_library.rb b/lib/puppet/type/websphere_shared_library.rb index c1af65ec..227b2a9f 100644 --- a/lib/puppet/type/websphere_shared_library.rb +++ b/lib/puppet/type/websphere_shared_library.rb @@ -92,7 +92,7 @@ def self.title_patterns ], # /opt/IBM/WebSphere/AppServer/profiles:PROFILE_DMGR_01:server:CELL_01:AppNode01:AppServer01:PuppetTest [ - %r{^(.*):(.*):(server):(.*):(.*):(.*):(.*)$}, + %r{^(.*):(.*):(server):(.*):(.*):(.*)$}, [ [:profile_base], [:dmgr_profile],