The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Feature #11629

Track and report origins of duplicate resources when collecting with StoreConfigs

Added by Anonymous almost 3 years ago. Updated about 2 years ago.

Status:AcceptedStart date:12/29/2011
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:exported resources
Target version:-
Affected Puppet version:2.7.0 Branch:
Keywords:

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This ticket may be automatically exported to the PUP project on JIRA using the button below:


Description

When there is an overlap of either local or remote resources in StoreConfigs, by the standard type and title rules, you end up with an error in your catalog compilation.

In #11423 we made the error message less confusing, but we should actually track where collected resources come from and be able to report the exact source – local, remote, which machines, etc – that causes the problems.

The expected result is that we can have a report that two machines, identified by their certnames, caused duplicate resources – even if they are imported in separate collect statements. eg:

# on host1
@@file { "/tmp/test": ensure => present, tag => "foo" }

# on host2
@@file { "/tmp/test": ensure => present, tag => "bar" }

# on host3
File <<| tag == "foo" |>>
File <<| tag == "bar" |>>

…leads to an error that identifies “host1” and “host2” as exporting overlapping resources, ideally pointing to the exact location in their manifests that triggers the error.


Related issues

Duplicated by Puppet - Bug #12238: Exported resources doesn't include the file where the pro... Duplicate 01/27/2012
Follows Puppet - Bug #11423: Misleading error message when you import duplicate resour... Closed 12/15/2011

History

#1 Updated by Josh Cooper over 2 years ago

About the “exact location”, this is important for example if you use a tag to bind the exported/imported resource, and the tag is not referenced in the error message:

$ puppet agent --test --certname host3 --server sirrus.puppetlabs.lan
err: Another local or imported resource exists with the type and title File[/tmp/test] on node host3

Also available in: Atom PDF