Issue #18490 has been updated by Ryan Coleman.

It looks like the ensure_resource function from 
[puppetlabs-stdlib](http://forge.puppetlabs.com/puppetlabs/stdlib) is a pretty 
effective work-around for baked in support for duplicate resource definitions. 

>From the documentation:
<pre>
ensure_resource
Takes a resource type, title, and a list of attributes that describe a resource.

user { 'dan':
  ensure => present,
}
This example only creates the resource if it does not already exist:

ensure_resource('user, 'dan', {'ensure' => 'present' })
If the resource already exists but does not match the specified parameters, 
this function will attempt to recreate the resource leading to a duplicate 
resource definition error.

An array of resources can also be passed in and each will be created with the 
type and parameters specified if it doesn't already exist.

ensure_resource('user', ['dan','alex'], {'ensure' => 'present'})
Type: statement
</pre>

----------------------------------------
Feature #18490: Duplicate resources can make re-usable Forge modules difficult
https://projects.puppetlabs.com/issues/18490#change-97899

* Author: Ryan Coleman
* Status: Investigating
* Priority: Normal
* Assignee: Ryan Coleman
* Category: modules
* Target version: 3.x
* Affected Puppet version: 
* Keywords: 
* Branch: 
----------------------------------------
[EDIT] Re-working this description based on feedback in comment #7. 

User installs module A to provide a web application. 

User installs module B to provide a database server.

Both module A and module B declare a package resource for foo. 

User declares classes from both module A and B on the same node.

User receives duplicate resource declaration error, Puppet run fails. 


I wish to prevent customers of Forge and Puppet from experiencing this 
frustration, when both classes really do need that package for their 
functionality but cannot be used together as-is. I'd love direct questions if 
you need to understand this better from my perspective.



-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" 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-bugs.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to