Ask Your Question

How do I declare a defined type from top scope?

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

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

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

llowder gravatar image

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

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

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

glarizza gravatar image

This is most likely the issue Lee is referring to -->

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


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

Seen: 352 times

Last updated: Dec 22 '12