i'm running in an Error: Duplicate declaration
with my puppet project. I want to deploy jboss instances, and part of them are some special config files.
As soon as i create a 2nd instance, which should contain the same special config files as the first instance, i get the mentioned error.
I create an instance like this:
jbossas::instance { 'node01':
...
propfiles => [ "kupo.properties", "web.properties" ],
}
in jboss::instance is this code:
if ($propfiles != {}) {
jbossas::makepropies { $propfiles:
version => $version,
instancedir => $instancedir,
jboss_name => $name,
}
}
and finally the makepropies code:
define jbossas::makepropies (
$file = $title,
$version = 7,
$instancedir = '',
$jboss_name = "jboss",
){
file { "$instancedir_$jboss_name_$file" :
ensure => file,
path => $instancedir/configuration/$file,
content => template("jbossas/jboss${version}/${file}.erb"),
require => Jbossas::Profile[$jboss_name],
}
}
As soon as i create a second node and want to apply the manifest the error i get is:
Error: Duplicate declaration: Jbossas::Makepropies[kupo.properties] is already declared in file /etc/puppet/modules/jbossas/manifests/instance.pp:111; cannot redeclare at /etc/puppet/modules/jbossas/manifests/instance.pp:111 on node jb7-dev.localdomain
I just started with puppet this week, so my expirience is like 0. I've searched a lot, found virtual/realize things, but couldn't find anything that solved my problem.
Thanks in advance!