On Thursday, October 8, 2015 at 3:38:55 AM UTC-5, Sergiu Cornea wrote: > > Hi Martin, > > Thank you for your response. > > This is the code I have developed: > > http://pastebin.com/76SzwhZV > > Are we to assume that the commented-out File declaration in that code is the one that causes the difficulty? So that the error occurs with the definition below?
define omd::omd_create::omd_rules ( $omd_site = '', $omd_service = [], $omd_ip = [], $h = {}, ) { file { $title: path => '/omd/sites/test/etc/check_mk/multisite.d/wato/bi.mk', ensure => file, content => template('omd/bi.mk.erb'), } } That would be completely believable. Although the definition is not inherently erroneous, it only accommodates a single instance, because it declares a file resource with a fixed path, and any second instance will therefore attempt to declare a duplicate resource. It's unclear what you're trying to do here. If you are trying to manage separate files then of course you need to specify each one's name. If you are trying to manage a single file with information gleaned from multiple resources, then then consider looking into the Concat module. On the other hand, if you are indeed trying to manage a single file, then consider whether you can instead do it via a single resource -- it appears that your code could be modified to accommodate that, but it depends to some extent on how it is used, and what you want to do with it in the future. John -- 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/6cc0acf5-7db7-4cb9-af3c-921c63c6d57a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.