chef-java-management
chef-java-management copied to clipboard
Truststore installation fails if a JRE is installed instead of a JDK.
Recipe truststore fails when a JRE is installed. Chef client ends with the following error:
==> default: [2014-10-10T23:07:49+00:00] ERROR: file[/usr/java/default/jre/lib/security/truststore-my_root.pem] (java-management::truststore line 32) had an error: Chef::Exceptions::EnclosingDirectoryDoesNotExist: Parent directory /usr/java/default/jre/lib/security does not exist.
This is due to the following assignment in the recipe:
certificate_file = "#{node['java']['java_home']}/jre/lib/security/truststore-#{certalias}.pem"
certificate_file is a valid path when a JDK is installed. In case of a JRE installation, this path should be:
certificate_file = "#{node['java']['java_home']}/lib/security/truststore-#{certalias}.pem"
The default value of the keystore attribute in the truststore LWRP provider should also be set accordingly.
A possible fix could be to allow setting this path as a cookbook attribute.
Thank you for your support.