I am creating a custom resource and would like to make it as self-contained as possible. I need to determine java version that is going to be available on the node so I will be able to setup JAVA_OPTS variable properly, depending on Java version. I would prefer to find this out without making resource's client to pass this information as a parameter. Could you please suggest me some solutions?
Kind regards,
Denuil
Use the
shell_out!
helper method to runjava -version
and parse the output. You can look at the data in the Ohai languages plugin which does already check some of this for you.