Btw, Rip or anyone, any suggestion on how to sort alphabetically the
scope variables so that the generated yaml doesn't change at (almost)
every puppet run?
content  => inline_template("<%= scope.to_hash.reject { |k,v| k.to_s
=~ /(uptime_seconds|timestamp|free)/ }.to_yaml %>")

On 2 Set, 20:26, "R.I.Pienaar" <r...@devco.net> wrote:
> ----- Original Message -----
>
> > At the end of the day, this all seems to be a limitation with
> > mcollective. It can only read facts from one source, either facter
> > or a yaml file. I believe facter is the current source, and people
> > have written scripts that rely on that. I can write a custom fact,
> > but.... then the issue becomes that I don't know if it's possible
> > for a custom fact written in ruby and dropped into
> > $module/lib/puppet can access variables defined in the node.
>
> using the yaml file built by a template method that was linked to
> any variables you set at the node level, top scope or in the class
> that creates the yaml file is put in the yaml file.
>
> Therefore you can use these files in mcollective filters, so if you
> just set variables in the node to do whatever you want they will show
> up in the yaml file and be usable.
>
> As the wiki says:
>
> "plus it lets you get any in-scope variables (for example, parameters from 
> your external node classifier) available as mcollective filters for free."
>
> http://projects.puppetlabs.com/projects/mcollective-plugins/wiki/Fact...
>
> Mcollective thus gets a combination of facts, variables etc all in one
> place.  You can even create many yaml files and it will read the lot for
> you, one local the node, one by puppet, maybe even with facter -y etc.
>
> and if all this fails, you can trivially write your own fact source that
> does whatever you want.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to