Good Day Puppet Experts,
am running a facter code in puppet master something like this to run a jar file.
if servertype == 'app' or servertype == 'java'
Facter.add('monitor_javaversion') do
setcode do
Facter::Core::Execution.execute('java -jar /appl/monitor/monitor.jar -v')
end
end
in this case, java path is not set across all systems. is there a better way to code this something like..
1. find for "bin/java" and use that path to find the version.
something like below but instead of "which", looking for "find or locate"
if Facter::Util::Resolution.which('httpd')
apache_version = Facter::Util::Resolution.exec('httpd -V 2>&1')
any help would be much appreciated.