vStone / puppet-percona

EOL: Please use puppetlabs mysql.
Other
4 stars 9 forks source link

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

Open pablokbs opened 10 years ago

pablokbs commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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.

pablokbs commented 10 years ago

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

EDIT: I will leave the issue open

arioch commented 10 years ago

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 commented 9 years ago

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