Skip to content

Commit b51a8e4

Browse files
authored
Merge pull request #399 from cbntss/ensure_absent
Don't require certificate or private key params when ensure: absent
2 parents 7048b5a + eb0df8b commit b51a8e4

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

lib/puppet/type/java_ks.rb

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -240,16 +240,18 @@ def self.title_patterns
240240
end
241241

242242
validate do
243-
unless value(:certificate) || value(:certificate_content)
244-
raise Puppet::Error, "You must pass one of 'certificate' or 'certificate_content'"
245-
end
243+
if self[:ensure] != :absent
244+
unless value(:certificate) || value(:certificate_content)
245+
raise Puppet::Error, "You must pass one of 'certificate' or 'certificate_content'"
246+
end
246247

247-
if value(:certificate) && value(:certificate_content)
248-
raise Puppet::Error, "You must pass either 'certificate' or 'certificate_content', not both."
249-
end
248+
if value(:certificate) && value(:certificate_content)
249+
raise Puppet::Error, "You must pass either 'certificate' or 'certificate_content', not both."
250+
end
250251

251-
if value(:private_key) && value(:private_key_content)
252-
raise Puppet::Error, "You must pass either 'private_key' or 'private_key_content', not both."
252+
if value(:private_key) && value(:private_key_content)
253+
raise Puppet::Error, "You must pass either 'private_key' or 'private_key_content', not both."
254+
end
253255
end
254256

255257
if value(:password) && value(:password_file)

0 commit comments

Comments
 (0)