hi,
it's a stupid example but nevertheless it would be interesting to now
why the following throws a duplicate resource error under puppet 3.7.4
and puppet 4.2.1
test/manifests/init.pp:
# start puppet code
class test inherits test::subclass {
notify { 'hello?': }
}
include test
#end puppet code
test/manifests/subclass.pp:
# start puppet code
class test::subclass {}
# end puppet code
running
# puppet apply --modulepath=.../modules .../modules/test/init.pp
throws a duplicate resource error (4.2.1 error message):
Error: Evaluation Error: Error while evaluating a Resource Statement,
Duplicate declaration: Notify[hello?] is already declared in file
/vagrant/modules/test/manifests/init.pp:2; cannot redeclare at
/vagrant/modules/test/manifests/init.pp:2 at /vagrant/modules/test/manif
ests/init.pp:2:3 on node centos7.eb.lan.at
if i remove 'inherits test::subclass' from init.pp it works:
Notice: Compiled catalog for centos7.eb.lan.at in environment production
in 0.32 seconds
Notice: hello?
Notice: /Stage[main]/Test/Notify[hello?]/message: defined 'message' as
'hello?'
Notice: Applied catalog in 0.02 seconds
also removing 'include test' in init.pp and running
puppet apply --modulepath=/vagrant/modules
/vagrant/modules/test/manifests/init.pp -e 'include test'
works
Notice: Compiled catalog for centos7.eb.lan.at in environment production
in 0.29 seconds
Notice: hello?
Notice: /Stage[main]/Test/Notify[hello?]/message: defined 'message' as
'hello?'
Notice: Applied catalog in 0.02 seconds
any hints?
thanks for your time and help
toni
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/86twd0dx53.fsf%40stderr.at.
For more options, visit https://groups.google.com/d/optout.