On 28/09/16 14:30, Toni Schmidbauer wrote:
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
Yes, then it does nothing - so that would work :-)
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?
I tried this on latest puppet:
=== test.pp
class test::subclass {}
class test inherits test::subclass {
notify { 'hello?': }
}
include test
puppet apply test.pp
And that works - does that fail for you ?
- henrik
thanks for your time and help
toni
--
Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/
--
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/34a93418-1455-0c01-5e43-1ddcbc7b591c%40puppet.com.
For more options, visit https://groups.google.com/d/optout.