You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
does already check for some attributes, but not for the dates of the certificate.
I did that in an alternative provider like
defexists?returnfalseunlessPathname.new(resource[:path]).exist?debug'Certificate found, checking validity.'cert=OpenSSL::X509::Certificate.new(File.read(resource[:path]))debug"Certificate parsed as #{cert.pretty_inspect}"raise'No validity dates found in certificate.'ifcert.not_before.nil? || cert.not_after.nil?(cert.not_after - Time.now).to_i > (30 * 24 * 3600)# certificate valid for more than 30 daysend
This will consider the certificate absent if there is less than 30 days left to its not_after date, i.e. the certificate expires within 30 days. If the resource is considered absent, Puppet will call the create method of the provider.
Affected Puppet, Ruby, OS and module versions/distributions
How to reproduce (e.g Puppet code you use)
What are you seeing
When the certificate expires, puppet doesn't appear to care
What behaviour did you expect instead
When the certificate expires, a new cert would be generated from the private key
Output log
Any additional information you'd like to impart
The text was updated successfully, but these errors were encountered: