Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help! #277

Closed
wgregorian opened this issue Sep 24, 2013 · 4 comments
Closed

Help! #277

wgregorian opened this issue Sep 24, 2013 · 4 comments

Comments

@wgregorian
Copy link

I feel like a nincompoop. I have

class { 'mysql::server':
}
class { 'mysql::globals':
override_options => { 'mysqld' => { 'max_connections' => '1024' } }
}

On my node for purely academic purposes to test the module, but it keeps coming up with the following error:

err: Could not retrieve catalog from remote server: Error 400 on SERVER: Duplicate declaration: Class[Mysql::Globals] is already declared; cannot redeclare at node.pp:208 on node build0.local
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run

Have I missed something entirely obvious?

@apenney
Copy link
Contributor

apenney commented Sep 24, 2013

You haven't - you've exposed a problem with my testing (which is that I was relying on just include and hiera.)

When you do a class { 'mysql::globals': } it then clashes with the inherits in mysql::server and fails. I'm just trying to think my way through the chain of events to work out the best way to handle this.

@apenney
Copy link
Contributor

apenney commented Sep 24, 2013

The reason I never spotted this was actually, after more testing, because in all tests I've done:

class { 'mysql::globals': }
class { 'mysql::server': }

It only fails if you include them in a reverse order.

The original idea was that globals can just be inherited by things in case you don't want to define it and then ::client and ::server can share it. This may not work out great.

I am going to think about this more and if this is unfixable swap to maybe bringing globals's override_options right into mysql::server and not allowing it to be exposed to mysql::client.

@wgregorian
Copy link
Author

Agreed on bringing override_options into mysql::server. Personally, I think it make more sense to have the override options in server since that's really where I would expect them to be. I suppose, it's a matter of preference ;)

@apenney
Copy link
Contributor

apenney commented Sep 24, 2013

#278 does this, I think it's a better move after thinking it over. I tried to mirror postgresql but it just didn't "fit" or feel right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants