On Thu, Sep 1, 2011 at 5:40 PM, Douglas Garstang <doug.garst...@gmail.com>wrote:

> Nigel,
>
> Are you referring to the 'Class Filters' section on
> http://docs.puppetlabs.com/mcollective/reference/integration/puppet.html ?
>
> If so, that's not really the same thing. Classes.txt lists classes included
> on a server. That's not what I am looking for. Life isn't always as simple
> as assuming that all machines within a certain functional group include the
> same class. You'd think so, but hey, I work for a startup, so not everything
> is engineered that well.
>

That's not an immense amount of engineering.... and if your functional
groups don't actually map well to classes, that's a sign of a problem that
you should be resolving as it's almost certainly causing wasted effort.


>
> All I want to be able to do is set a variable on a per node basis that
> defines a functional grouping, ie a class of server, and query that with
> mcollective. Should not be difficult to do.
>

There are many hoops you could jump through to achieve this like making a
file that your node parameters get pushed to in a template, and then make
facts that query that file...

but honestly, work with the system and not against it. Make some functional
classes that correspond to the node parameters you're talking about, and
include them.

I can't remember off the top of my head what happens with completely empty
classes, they may not actually get written out to classes.txt, but I'd test
that first. If that fails, stick some dummy resources in, but your best bet
is to start making functional classes mapping to the subset of nodes you
want to pick out, and organize your existing classes by function where
appropriate.




> Doug.
>
>
> On Thu, Sep 1, 2011 at 5:37 PM, Douglas Garstang 
> <doug.garst...@gmail.com>wrote:
>
>> Thanks Nigel, but there's no mention of classes.txt on that page.
>>
>>
>> On Thu, Sep 1, 2011 at 5:16 PM, Nigel Kersten <ni...@puppetlabs.com>wrote:
>>
>>>
>>>
>>> On Thu, Sep 1, 2011 at 5:02 PM, Douglas Garstang <
>>> doug.garst...@gmail.com> wrote:
>>>
>>>> On Thu, Sep 1, 2011 at 4:58 PM, Aaron Grewell 
>>>> <aaron.grew...@gmail.com>wrote:
>>>>
>>>>> And then assign classes based on that.  Standard if logic or case
>>>>> statement as you prefer.
>>>>>
>>>>> On Thu, Sep 1, 2011 at 4:57 PM, Douglas Garstang <
>>>>> doug.garst...@gmail.com> wrote:
>>>>>
>>>>>> On Thu, Sep 1, 2011 at 4:56 PM, Aaron Grewell <
>>>>>> aaron.grew...@gmail.com> wrote:
>>>>>>
>>>>>>> Create a variable for server_class in your node definition.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> And then....?
>>>>>>
>>>>>>
>>>>>> This isn't for logic within puppet manifests. In this particular
>>>> scenario, it's for setting a server class on each node so that I can use
>>>> mcollective against servers matching that class. For example, if I wanted 
>>>> to
>>>> stop apache on the web servers, I can call mc-service httpd restart -F
>>>> "hostclass=webserver" etc.
>>>>
>>>>
>>> http://docs.puppetlabs.com/mcollective/reference/ui/filters.html
>>>
>>> $ mco rpc --help . . . Host Filters -W, --with FILTER Combined classes
>>> and facts filter -F, --wf, --with-fact fact=val Match hosts with a
>>> certain fact -C, --wc, --with-class CLASS Match hosts with a certain
>>> config management class -A, --wa, --with-agent AGENT Match hosts with a
>>> certain agent
>>> -I, --wi, --with-identity IDENT Match hosts with a certain configured
>>> identity
>>>
>>>
>>>
>>> You want to match a class, not a fact.
>>>
>>> MCollective can match based on Puppet classes already by reading
>>> classes.txt which contains all the classes from the latest catalog.
>>>
>>>
>>>  --
>>> 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.
>>>
>>
>>
>>
>> --
>> Regards,
>>
>> Douglas Garstang
>> http://www.linkedin.com/in/garstang
>> Email: doug.garst...@gmail.com
>> Cell: +1-805-340-5627
>>
>>
>
>
> --
> Regards,
>
> Douglas Garstang
> http://www.linkedin.com/in/garstang
> Email: doug.garst...@gmail.com
> Cell: +1-805-340-5627
>
>  --
> 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.
>



-- 
Nigel Kersten
Product Manager, Puppet Labs

*Join us for **PuppetConf *
<http://www.bit.ly/puppetconfsig>
Sept 22/23 Portland, Oregon, USA.
*
*

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