On 10/10/2014 07:57 PM, Spriya wrote:
> Hi,
>
> require 'facter'
>
> ary = [1,2,3,4,5]
>
> ary.each do |numbers|
> Facter.add("base") do
> setcode do
> "#{numbers} "
> end
> end
> end
>
> In the fact it is returning only 1 value. In the fact it is returning
> base = 1 only not returning 2 3 4
First off, this description is way too vague to even start guessing
where you are going with this. It would be helpful if you can describe
what you are trying to solve in the long run.
Anyway, here is what I think you may want. Perhaps.
ary.each do |num|
Facter.add("base#{num}") do
setcode { num.to_s }
end
end
You get five facts, with the value equal to the respective index.
HTH,
Felix
--
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/54386B89.2010307%40Alumni.TU-Berlin.de.
For more options, visit https://groups.google.com/d/optout.