Issue #23071 has been reported by Thomas Vander Stichele.
----------------------------------------
Bug #23071: puppet parser gets confused when naming a nested module after
another module
https://projects.puppetlabs.com/issues/23071
* Author: Thomas Vander Stichele
* Status: Unreviewed
* Priority: Normal
* Assignee:
* Category:
* Target version:
* Affected Puppet version: 3.2.1
* Keywords:
* Branch:
----------------------------------------
There is a module nagios::server in my module tree.
I add a wrapper module for it in my company-specific module tree.
That module is ept::nagios::server which is named such that it's obvious (to
future me) that this wraps nagios::server as used by our company.
However, it seems that then doing
class { 'nagios::server': ... }
triggers this problem:
Error: Duplicate declaration: Class[Ept::Nagios::Server] is already declared; ca
nnot redeclare on node puppetclient.virt
with parts of the backtrace:
/usr/lib/ruby/site_ruby/1.8/puppet/resource/catalog.rb:538:in `fail_on_duplicate
_type_and_title'
/usr/lib/ruby/site_ruby/1.8/puppet/resource/catalog.rb:76:in `add_resource'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:59:in `add_resource'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast/resource.rb:59:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/util/errors.rb:61:in `exceptwrap'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast/resource.rb:43:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast/resource.rb:42:in
`collect'/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast/resource.rb:42:in
`collect'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast/resource.rb:42:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/lexer.rb:221:in `collect'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast/branch.rb:16:in `each'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast/branch.rb:15:in `each'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast/resource.rb:25:in `collect'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast/resource.rb:25:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast.rb:62:in `safeevaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast/block_expression.rb:15:in `evaluat
e'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast/block_expression.rb:10:in `each'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast/block_expression.rb:10:in `evaluat
e'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast.rb:62:in `safeevaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/resource/type.rb:137:in `evaluate_code'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/resource.rb:81:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:166:in `evaluate_classes'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:151:in `each'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:151:in `evaluate_classes'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/functions/include.rb:11:in
`real_function_include'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/functions.rb:147:in `send'
r/lib/ruby/site_ruby/1.8/puppet/parser/functions.rb:147:in `function_include'
/usr/lib/ruby/site_ruby/1.8/puppet/util/profiler/none.rb:6:in `profile'
/usr/lib/ruby/site_ruby/1.8/puppet/util/profiler.rb:26:in `profile'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/functions.rb:140:in `function_include'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast/function.rb:42:in `send'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast/function.rb:42:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast.rb:62:in `safeevaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast/block_expression.rb:15:in `evaluat
e'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast/block_expression.rb:10:in `each'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast/block_expression.rb:10:in `evaluat
e'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/ast.rb:62:in `safeevaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/resource/type.rb:137:in `evaluate_code'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/resource.rb:81:in `evaluate'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:293:in `evaluate_main'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:97:in `compile'
/usr/lib/ruby/site_ruby/1.8/puppet/util/profiler/none.rb:6:in `profile'
/usr/lib/ruby/site_ruby/1.8/puppet/util/profiler.rb:26:in `profile'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:97:in `compile'
/usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:29:in `compile'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:86:in `compile
'
/usr/lib/ruby/site_ruby/1.8/puppet/util/profiler/none.rb:6:in `profile'
/usr/lib/ruby/site_ruby/1.8/puppet/util/profiler.rb:26:in `profile'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:84:in `compile
'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:44:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/indirector/indirection.rb:197:in `find'
/usr/lib/ruby/site_ruby/1.8/puppet/application/apply.rb:209:in `main'
/usr/lib/ruby/site_ruby/1.8/puppet/application/apply.rb:151:in `run_command'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:364:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:456:in `plugin_hook'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:364:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/util.rb:504:in `exit_on_fail'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:364:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:132:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:86:in `execute'
/usr/bin/puppet:4
Prefixing the nagios::server in the class statement with :: works around this.
However, I don't think I've seen that sytnax recommended anywhere for modules,
so it may not be intentional.
In any case, suggest that this either gets fixed or codified as the correct
workaround.
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.