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. 



-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/f286c937-f533-425c-8ad7-a4cc7e2eea06n%40googlegroups.com.

Reply via email to