Hi All,I am trying to get all the java versions and paths where it is located. I got all java_paths in a fact called java_path. Now i need those versions in each custom facts.I wrote a code but this not executing .
--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/fe7859b3-2eac-4e9c-b495-d4e20dc6dac1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Puppet Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/puppet-dev/P6o7RUvvNFo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to puppet-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/CANhgQXuHw%2BVWX47Knw6tNeY2A0c0y5P%3DpRo1%2BWC5gK_ipvXh1A%40mail.gmail.com.
Hi,It isn't executing anything. it means it is not showing individual fact for each java version. yes my facts(java_version_count ) is showing me how many lines(means java) i have in java.txt. yes i placed in wright location.I followed the link which you provided me.I feel some thing is wrong here, i think
logfile = '/home/suppalapati/java.txt'line_num=0log = Facter::Util::FileRead.read(logfile)unless log.nil?log.each_line do |line|if line.include?('java')line_num += 1javaid, val = %x[ #{log} ]
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/CAEySWyFiNGwEwGd3PE3wAWomkea8ryCWTYS1-pvXrDHTtgvQ%3Dg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/CANhgQXv9onfSx%3DZQg-08XkiNUb1q%2BUo_xE32%2BgGvZJb_qgEbhg%40mail.gmail.com.
Hi Andrey,When i tried your example, It is not returning any valuesrequire 'facter/util/file_read'=> trueirb(main):005:0> log = Facter::Util::FileRead.read("/home/suppalapati/java.txt")=> "\n/usr/java/jdk1.7.0_25/jre/bin/java\n/usr/java/jdk1.7.0_25/bin/java\n/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.45.x86_64/jre/bin/java\n/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/bin/java\n\n"irb(main):006:0> log.each_line do |line|irb(main):007:1* javaid, val = %x{line}irb(main):008:1> javaid, val = %x{java}irb(main):009:1> val = %x{java}irb(main):010:1> val = %x{line}irb(main):011:1> val = %x{log}irb(main):012:1> val = %x{i}irb(main):013:1> value = %x['#{i} -version']irb(main):014:1> valirb(main):015:1>
Let me know
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/CAEySWyG-05AtKBMad1UcNVMnK3z7YqJop%3D5pqSs-ufu9cX%2BjyQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/CANhgQXs3oPx0soS2MiHycLJjUhcZHJu96zFxXMtOV90Tsfd4Qw%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/fe7859b3-2eac-4e9c-b495-d4e20dc6dac1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--Andrew ParkerFreenode: zaphod42Twitter: @aparker42Software Developer
--
You received this message because you are subscribed to a topic in the Google Groups "Puppet Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/puppet-dev/P6o7RUvvNFo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to puppet-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/CANhgQXuHw%2BVWX47Knw6tNeY2A0c0y5P%3DpRo1%2BWC5gK_ipvXh1A%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/CAEySWyFiNGwEwGd3PE3wAWomkea8ryCWTYS1-pvXrDHTtgvQ%3Dg%40mail.gmail.com.
--Andrew ParkerFreenode: zaphod42Twitter: @aparker42Software Developer
--
You received this message because you are subscribed to a topic in the Google Groups "Puppet Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/puppet-dev/P6o7RUvvNFo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to puppet-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/CANhgQXv9onfSx%3DZQg-08XkiNUb1q%2BUo_xE32%2BgGvZJb_qgEbhg%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/CAEySWyG-05AtKBMad1UcNVMnK3z7YqJop%3D5pqSs-ufu9cX%2BjyQ%40mail.gmail.com.
--Andrew ParkerFreenode: zaphod42Twitter: @aparker42Software Developer
--
You received this message because you are subscribed to a topic in the Google Groups "Puppet Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/puppet-dev/P6o7RUvvNFo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to puppet-dev+unsubscribe@googlegroups.com.
Where is in the facts it is not showing anything:$/opt/puppet/bin/facter -p | grep -i java_*Here is my code:logfile = '/home/suppalapati/java.txt'line_num=0log = Facter::Util::FileRead.read(logfile)unless log.nil?log.each_line do |line|if line.include?('java')line_num += 1javaid, val = %x[#{log}]Facter.add("java_#{javaid}") dosetcode doputs val
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/953f3e46-700e-4d72-8889-24661a864697%40googlegroups.com.To unsubscribe from this group and stop receiving emails from it, send an email to puppet-dev+...@googlegroups.com.
To unsubscribe from this group and all its topics, send an email to puppet-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/CANhgQXtf05LrCHrtX032H3i7sp_exyLwfobwqas2X0Qq_m32Gw%40mail.gmail.com.