On Sep 8, 2014, at 8:31 AM, Pedro César <pedrocesar...@gmail.com> wrote:
> I'm not sure if I'm doing right or something I've done is stupid, but I have > a question. > > I have multiple hosts and multiple modules to manage these hosts, but > eventually, I have same resources for different modules and the Puppet > complaint about it. > > I mean, I have two different modules that guarantee a folder be created, one > of those modules I use to couple hosts and another one I use for the other > hosts. However I need use both modules for one particular host and then my > nightmare starts, because always Puppet complaint, saying: Error 400 on > SERVER: Duplicate declaration. > > I know is duplicated, but it's different modules and I have to guarantee both > modules declare that resours. > > Is there any way to skip this problem? The easiest way to resolve the problem is to move the folder resource into a separate class and make it a virtual resource. Then inside your two existing modules, include the virtual resource class, and then realize the virtual resource. Like all other resource declarations, you can only declare a virtual resource once, but you can realize it any number of times. This puppet doc should give you all the information you need: https://docs.puppetlabs.com/puppet/latest/reference/lang_virtual.html -- Peter Bukowinski -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/0114B394-5FED-4E9C-BAE9-92A201844022%40gmail.com. For more options, visit https://groups.google.com/d/optout.