So this is a duplicate exported resource. Something in your content
has created this scenario at some time, and its usually either a)
genuine, you really have exported the same type/title combination
twice from two nodes, and are now collecting it onto one, a constraint
violation or b) an old node has exported this in the past, and that
node has not been deactivated.
The trick is to figure out how to debug these issues, since they are
often quite solveable.
Zach Smith has created a tool for analyzing what has been exported to
PuppetDB:
http://forge.puppetlabs.com/zack/exports and this is a great
start.
You can also query this manually yourself:
$ curl '
http://localhost:8080/v3/resources?query=\["=","exported",true\]'
In general, the trick to avoid this error is to make sure the types
you export can never collide. In your code:
@@file { 'foo-yum':
path => '/etc/yum.repos.d/foo.repo',
}
... you are exporting something with a very fixed title and namevar
(foo-yum and path respectively) ... basically if two nodes export
this, you will always get a collision on the collecting host, so the
pattern you have will only work if there is 1 export, or if you pin
the collection query to the node that exported it.
To be honest though - exported resources might not be appropriate for
this yum repo use case anyway, although perhaps I don't see it :-).
Can you explain why you are trying to use exported resources for this
purpose?
ken.