On 17 May 2013 13:05, joe <[email protected]> wrote:

> The easiest thing to do would to make a subclass called cups::enabled or
> similar and use an override:
>
> class cups::enabled inherits cups{  # The inherits is important
>
>   Package['cups']{
>     ensure => 'present,
>   }
>
>   Add service and config file resources here
>
> }
>
> The problem with trying to use hiera is it just gets you the package
> ensure parameter. With the override, you can add in the service and config
> file resources as well.


Um what?
Hiera is only for setting variables, usually for paremeterized classes.

Using your solution you will still needs include that class individually on
the nodes that need cups installed.
How will you decide that?

If you have one module included on each node and a class variable set with
hiera to determine which nodes need cups and which don't you can use that
in the class to uninstall cups or turn off the service or whatever you like.

Hiera is about separating that data from your code and making it more
portable.
So in this case it is the best way to achieve that with minimal headaches
and code rewrites in the future.



>
> On Thursday, May 16, 2013 6:33:25 PM UTC-6, Stephen Wallace wrote:
>>
>> Hi all,
>>
>> I know that there are likely a few ways to solve the following. I just
>> don't know what the best way may be :)
>>
>> We're trying to work out how do something similar to the following
>> scenario.
>>
>> How do we apply a policy to uninstall CUPS from all servers, except for
>> a configurable group of "some".
>>
>> To put it another way, how can we have an policy that will configure CUPS
>> on a known list of servers (hiera array perhaps?), and uninstall from all
>> other $kernel=Linux machines?
>>
>> Best to get the install list right first then feed via ENC, or?
>>
>> Regs,
>>
>> Stephen
>>
>  --
> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/puppet-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to