On Sep 20, 2010, at 10:57 PM, denmat wrote:

> Thanks for the swift response Patrick, however it hasn't worked.  If I
> declare it in one place, it complains of a duplicate.
> 
> I'm thinking what I'm trying to do is not possible.
> 

class base
{
        package { "svn":
                ensure => installed,
        }
}

class remove_svn inherits base
{
        #Look up overrides in
        #http://docs.reductivelabs.com/guides/language_tutorial.html#classes
        #This bit is the key
        Package["svn"] {
                ensure => absent,
        }
}

#Also important!
include base

node default
{
        #Commenting and uncommenting this next line will install and uninstall 
the package.
#       include remove_svn
}


> 
> 
> On Sep 21, 1:14 pm, Patrick <[email protected]> wrote:
>> On Sep 20, 2010, at 8:01 PM, denmat wrote:
>> 
>>> Hi List,
>> 
>>> I have two questions.
>> 
>>> Firstly I want to be able to ensure a default package is installed
>>> across all hosts unless I specifically require them to be absent.
>> 
>>> To do this I have created a module(httpd) and class(php_mod) and
>>> definition(php_mod_add) which I want to declare at the default node or
>>> individual node level.
>> 
>> I believe you can do this by putting the "ensure => installed" resource in a 
>> parent and have the child override it.  Then you include the child when you 
>> want to remove the package.  Then include the parent in your global section.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.
> 

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

Reply via email to