Re: [Puppet Users] QUESTION: How can I iterate through the whole list of facters in an erb template?

2016-11-14 Thread Victor Martinez
Cool, Thanks, finally I used another approach

 scope.to_hash.reject { |k,v| !( k.is_a?(String) && v.is_a?(String) ) 
}.each do |k,v| -%>
<%= k %>-<%= v %>
<% end -%>


which it's basically based on:
- https://www.puppetcookbook.com/posts/see-all-client-variables.html

Cheers

On Thursday, 10 November 2016 14:51:14 UTC, Matt Zagrabelny wrote:
>
> On Thu, Nov 10, 2016 at 6:25 AM, Victor Martinez 
> > wrote: 
> > Hi there, 
> > 
> >I've been looking for a way of creating an erb file which contains 
> all 
> > the facter values. Any ideas how I can accomplish it? Reason: I'd like 
> to 
> > generate custom facters per module and populate those facter values as 
> > Jenkins Labels 
>
> Untested: 
>
> <% 
> @facts.each do |key, value| 
> %-> 
> <%= key %> and <%= value %> 
> <% end -%> 
>
> -m 
>

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/ed8b711c-0c2e-4b83-82c6-68e581dc0597%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] QUESTION: How can I iterate through the whole list of facters in an erb template?

2016-11-10 Thread Matt Zagrabelny
On Thu, Nov 10, 2016 at 6:25 AM, Victor Martinez
 wrote:
> Hi there,
>
>I've been looking for a way of creating an erb file which contains all
> the facter values. Any ideas how I can accomplish it? Reason: I'd like to
> generate custom facters per module and populate those facter values as
> Jenkins Labels

Untested:

<%
@facts.each do |key, value|
%->
<%= key %> and <%= value %>
<% end -%>

-m

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAOLfK3WWQ%3DfESunVMb3JyM2%3Dhr5%2BStyUQp58t0tV%3D01EKyvTdg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] QUESTION: How can I iterate through the whole list of facters in an erb template?

2016-11-10 Thread Victor Martinez
Hi there,

   I've been looking for a way of creating an erb file which contains all 
the facter values. Any ideas how I can accomplish it? Reason: I'd like to 
generate custom facters per module and populate those facter values as 
Jenkins Labels

Thanks so much

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/591f9dc9-84bb-4de9-8725-24d79836b489%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.