On Fri, Sep 2, 2011 at 12:06 PM, Douglas Garstang
<doug.garst...@gmail.com>wrote:

>
> On Fri, Sep 2, 2011 at 11:26 AM, 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/FactsFacterYAML
>>
>> 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.
>>
>> --
>>
>
> So, I think I had used this approach once before. But, now.... after
> implementing that, yes, facts.yaml seems to have all the facter variables as
> well as variables defined in the node, which is generally what I want.
>
> However, running mc-inventory shows no facts, and doing something like
> this:
>
> mc-service puppet status -F "hosttype=proxy"
>
> where hosttype=proxy does appear in the yaml file, returns no data. I have
> set the factsource to yaml in mcollective's server.cfg and restarted it.
>
> Douglas.
>
>

Eh. Now it's working. Weird.

-- 
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