Ask Your Question
1

How do I declare a defined type from top scope?

asked 2012-12-20 09:31:37 -0500

arnoudj gravatar image

I have made a class that uses the puppetlabs-mysql class. I had to declare the mysql::server class as top scope (::mysql::server) for it not to get confused with the nxs::mysql::server class, or else I would get a "Duplicate declaration: Class[Nxs::Mysql::Server]" error.

Now I also want to be able to pass some configs for mysql by using the mysql::server::config type, but this too gives an error. I probably have to specify the top scope here too, but can't find how to do it. ::mysql::server::config gives a compile error. What ... (more)

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
3

answered 2012-12-20 22:22:48 -0500

llowder gravatar image

updated 2012-12-21 17:45:07 -0500

Despite the similarities between parametrized classes and defined types, defined types are much closer in their behavior to the built in resource types (user, file, package, etc) than they are to classes.

Trying to reference a defined type in this manner would be comparable to trying to reference a user resource in top scope, ::user { 'bob': ... }

There have been a number of discussions on the puppet user list and in an assortment of bug reports that are related to this, though most of them relate to classes and the conflicts that can come from class foo::bar and class bar ... (more)

edit flag offensive delete link more
0

answered 2012-12-22 21:20:15 -0500

glarizza gravatar image

This is most likely the issue Lee is referring to --> https://projects.puppetlabs.com/issues/2053

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-12-20 09:31:37 -0500

Seen: 337 times

Last updated: Dec 22 '12