On Dec 16, 10:51 am, boddiesdrinker <[email protected]> wrote:
> where can i get some template samples that use the function_
> references?
>
> Many Thanks
> Martin
I replied in the other thread. I think you're hitting a bug. But this
is a working template that calls a core function:
<% value = scope.function_fqdn_rand(['10']) -%>
<%= "The random fqdn value is #{value}" %>
And a more complex example that prints a list of lines suitable for /
etc/hosts:
<%# returns a list of other puppet client fqdns %>
<% nodes = scope.function_list_nodes( ["{:classes =>
'puppet::client'}", "fqdn"] ) -%>
<% nodes.each do |fqdn| -%>
<%# lookup ipaddress and hostname of another client %>
<% ipaddr = scope.function_list_fact([fqdn, 'ipaddress']) -%>
<% hostname = scope.function_list_fact([fqdn, 'hostname']) -%>
<%= "#{ipaddr} #{fqdn} # {hostname}" %>
<% end -%>
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.