Duplicate resource declaration

Puppet builds our catalogs based on every resource declared in our manifests. In good Puppet code design, we have classes that include or contain other classes. During development, it's not uncommon to sometimes attempt to declare a resource that has been declared in a class that's already applied on the system. By design, Puppet will fail on a duplicate resource declaration, and for a good reason: How can the catalog decide which resource is the right resource to apply? In the following example, a resource is declared in two separate classes being applied to my node:

[root@pe-puppet-master production]# puppet agent -tInfo: Using configured environment 'production'Info: Retrieving pluginfactsInfo: Retrieving ...

Get Mastering Puppet 5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.