I've been using 'anti-classes' up to now.. hoping for a better way.. alas...


On Monday, October 27, 2014 11:17:12 AM UTC-7, Trevor Vaughan wrote:
>
> One day, long ago in 2008, there was a discussion on anti-classes: 
> http://comments.gmane.org/gmane.comp.sysutils.puppet.user/5884.
>
> Yeah, they're still irritating, but I don't really know how else to do it.
>
> init.pp ( $enable => true ) ==> Main Class
> init.pp ( $enable => false ) ==> Anti Class
>
> Trevor
>
> On Mon, Oct 27, 2014 at 11:54 AM, Brian Morris <nomadic...@gmail.com 
> <javascript:>> wrote:
>
>> This could be done in a stateful fashion. Start with a facter like this:
>>
>> Facter.add(:apache_exists) do
>>>
>>> confine :osfamily => "Debian"
>>>
>>> setcode do
>>>
>>> if Facter::Util::Resolution.exec("dpkg -l | grep apache2 | grep -v 
>>>> apache2-utils | grep ^ii")
>>>
>>> "true"
>>>
>>> end
>>>
>>> end
>>>
>>> end
>>>
>>>
>> ... and then, in a manifest, reference the facter to see if it is true:
>>
>> if ( $::apache_exists ) {
>>>
>>> do something,
>>>
>>> }
>>>
>>>
>>
>> Brian 
>>  
>>
>> On Sunday, October 26, 2014 5:18:44 AM UTC-7, JonY wrote:
>>>
>>> Let's say that I'm deploying a steady stream of identical hosts. Each 
>>> has some piece of SW on it that's managed by Puppet.  I continue to 
>>> (regularly) add to and maintain this group over time.
>>>
>>> Day comes when this SW is no longer required. 
>>>
>>> So I remove the module from Puppet to prevent it being included on 
>>> future hosts in this group. 
>>>
>>> "What about the existing hosts?" I ask.
>>> "Add a module to remove the SW" I think.
>>> "What about the future hosts? Won't this seem a bit odd to tell puppet 
>>> to remove SW that was never installed?" I wonder.
>>> "Puppet is idempotent!" says the FM. 
>>> "Ok - but it still seems amiss. To a 'distant observer' it would seem an 
>>> odd practice." says I.
>>>
>>> Should I break up the 'before' and 'after' hosts into separate groups / 
>>> environments? I use an ENC to manage the modules. Maybe a DB entry to 
>>> indicate who gets the extra module?
>>>
>>> Some other pathway?
>>>
>>  -- 
>> 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 puppet-users...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/puppet-users/825cb051-76b9-4353-8ee7-20c7b81d2896%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/puppet-users/825cb051-76b9-4353-8ee7-20c7b81d2896%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Trevor Vaughan
> Vice President, Onyx Point, Inc
> (410) 541-6699
> tvau...@onyxpoint.com <javascript:>
>
> -- This account not approved for unencrypted proprietary information -- 
>

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/00554a39-8c3f-472e-832d-86890ed73cfb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to