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

puppet-percona conflicts with puppetlabs-mysql when both installed (mysql provider issues) #20

Open
pablokbs opened this issue Jul 28, 2014 · 6 comments
Labels

Comments

@pablokbs
Copy link

Hello

I have this simple class:

class percona::custom {

        apt::source { 'percona':
                location        => 'http://repo.percona.com/apt',
                release         => 'precise',
                repos           => 'main',
                key             => '1C4CBDCDCD2EFD2A',
                key_server      => 'keys.gnupg.net',
        }


        class { 'apt': }
        class { 'percona':
                server          => true,
                percona_version => '5.6',
        }

        percona::database { 'dbfoo':
                ensure => present;
        }

        percona::rights {'user@localhost/dbfoo':
                priv     => 'select_priv',
                host     => 'localhost',
                database => '*',
                password => 'default',
        }

        Class['apt'] -> Class['percona']

}

The package is installed without issues, but the creation of the DB fails with the following error:

Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid parameter mgmt_cnf on Mysql_database[dbfoo] at /etc/puppet/modules/percona/manifests/database.pp:30 on node test.ish.co.za

I have the full error with debug enabled here:

http://pastebin.com/DXrp4zsp

Let me know if you need any more data. Thanks

@vStone
Copy link
Owner

vStone commented Jul 29, 2014

Do you have plugin sync enabled and/or perhaps the puppetlabs mysql module installed? Looks like an outdated or wrong version of the mysql provider.

@pablokbs
Copy link
Author

Yes, I have pluginsync enabled and I have the following modules

├── puppetlabs-apt (v1.5.0)
├── puppetlabs-concat (v1.1.0)
├── puppetlabs-mysql (v2.3.1)
├── puppetlabs-stdlib (v4.2.2)
├── vStone-percona (v1.3.3)

@vStone
Copy link
Owner

vStone commented Jul 29, 2014

So, the problem will be that the percona module will use the puppetlabs-mysql provider stuff. I'll have to give it some thought on how we can work around this issue. Probably will have to consult with the co-author @arioch.

@vStone vStone changed the title Can't manage DBs puppet-percona conflicts with puppetlabs-mysql when both installed (mysql provider issues) Jul 29, 2014
@vStone vStone added the bug label Jul 29, 2014
@pablokbs
Copy link
Author

Thank you, you are right. I deleted the puppetlabs-mysql and the problem was fixed.

EDIT: I will leave the issue open

@pablokbs pablokbs reopened this Jul 29, 2014
@arioch
Copy link

arioch commented Jul 29, 2014

In order to have both modules working we could evaluate renaming mysql_* functions to percona_*.
This would obviously break a number of environments.

I'd suggest that if we'd take this route to do it in a next major release and have a big fat warning next few minor releases.

We could also use a custom fact detecting both modules. Using fact precedence the Percona functions would get prioritised over Puppetlabs/MySQL functions.

lib/puppet/parser/functions/mysql_password.rb:  newfunction(:mysql_password, :type => :rvalue) do |args|
lib/puppet/provider/mysql_database/mysql.rb:Puppet::Type.type(:mysql_database).provide(:mysql) do
lib/puppet/provider/mysql_grant/mysql.rb:Puppet::Type.type(:mysql_grant).provide(:mysql) do
lib/puppet/provider/mysql_user/mysql.rb:Puppet::Type.type(:mysql_user).provide(:mysql) do
lib/puppet/type/mysql_database.rb:Puppet::Type.newtype(:mysql_database) do
lib/puppet/type/mysql_grant.rb:Puppet::Type.newtype(:mysql_grant) do
lib/puppet/type/mysql_user.rb:Puppet::Type.newtype(:mysql_user) do
manifests/database.pp:  mysql_database { $name:
manifests/rights.pp:  if ! defined(Mysql_user["${_user}@${_host}"]) {
manifests/rights.pp:      undef   => mysql_password($password),
manifests/rights.pp:    mysql_user { "${_user}@${_host}":
manifests/rights.pp:  mysql_grant { $grant_name:
manifests/rights.pp:      Mysql_user["${_user}@${_host}"],

@csdougliss
Copy link

I am using puppetlabs-mysql and just trying your percona plugin and have the same issue. Any updates on resolving this issue? Thanks

Edit: I've created a PR regarding this

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

No branches or pull requests

4 participants