The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Bug #15690

puppetlabs-mysql fails silently when pluginsync=true is not set

Added by Severin Kacianka about 2 years ago. Updated over 1 year ago.

Status:ClosedStart date:07/25/2012
Priority:NormalDue date:
Assignee:Ryan Coleman% Done:

0%

Category:mysqlSpent time:-
Target version:-
Keywords:puppetlabs-mysql, mysql, pluginsync Branch:https://github.com/puppetlabs/puppetlabs-mysql/pull/127

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This issue is currently not available for export. If you are experiencing the issue described below, please file a new ticket in JIRA. Once a new ticket has been created, please add a link to it that points back to this Redmine ticket.


Description

When pluginsync=true is not set, puppetlabs-mysql will complete some operations but not others without issuing any warning.

I used this node configuration:

node 'node.example.com'{
    class { 'mysql::server':
        config_hash => { 'root_password' => 'foo' }
    }
    mysql::db { 'testdb':
          user     => 'bob',
          password => 'bar',
          host     => 'localhost',
          grant    => ['all'],
    }

}

When running “puppet agent —no-daemonize —verbose —onetime —debug” on the client the root password will be set and changed, but the database will not be created. This is the relevant snippet from the debug output:

debug: /Stage[main]//Node[node.example.com]/Mysql::Db[testdb]/Database_user[bob@localhost]/require: requires Database[testdb]
debug: /Stage[main]/Mysql::Config/Exec[set_mysql_rootpw]/require: requires File[/etc/mysql/conf.d]
debug: /Stage[main]/Mysql::Config/Exec[set_mysql_rootpw]/notify: subscribes to Exec[mysqld-restart]
debug: /Stage[main]/Mysql::Server/before: requires Class[Mysql::Config]
debug: /Stage[main]//Node[node.example.com]/Mysql::Db[testdb]/Database[testdb]/require: requires Class[Mysql::Server]
debug: /Stage[main]/Mysql::Server/Service[mysqld]/require: requires Package[mysql-server]
debug: /Stage[main]//Node[node.example.com]/Mysql::Db[testdb]/Database_grant[bob@localhost/testdb]/require: requires Database_user[bob@localhost]
debug: /Stage[main]/Mysql::Config/File[/etc/mysql]/notify: subscribes to Exec[mysqld-restart]
debug: /Stage[main]/Mysql::Config/File[/etc/mysql/conf.d]/notify: subscribes to Exec[mysqld-restart]
debug: /Stage[main]/Mysql::Config/File[/root/.my.cnf]/require: requires Exec[set_mysql_rootpw]
debug: /Stage[main]/Mysql::Config/File[/root/.my.cnf]/notify: subscribes to Exec[mysqld-restart]
debug: /Stage[main]/Mysql::Config/File[/etc/mysql/my.cnf]/notify: subscribes to Exec[mysqld-restart]
debug: /Stage[main]/Mysql::Config/File[/etc/mysql/conf.d]: Autorequiring File[/etc/mysql]
debug: /Stage[main]/Mysql::Config/File[/etc/mysql/my.cnf]: Autorequiring File[/etc/mysql]

The problem seems to be that the resource is not created on the client:

# puppet resource database
Could not run: Could not find type database

If I add pluginsync=true to /etc/puppet/puppet.conf the datebase will be created:

puppet agent --no-daemonize --verbose --onetime
notice: /Stage[main]//Node[node.example.com]/Mysql::Db[testdb]/Database[testdb]/ensure: created
notice: /Stage[main]//Node[node.example.com]/Mysql::Db[testdb]/Database_user[bob@localhost]/ensure: created
notice: /Stage[main]//Node[node.example.com]/Mysql::Db[testdb]/Database_grant[bob@localhost/testdb]/privileges: privileges changed '' to 'all'

And the resource will exists:

# puppet resource database
database { 'information_schema':
  ensure  => 'present',
  charset => 'utf8',
}
database { 'mysql':
  ensure  => 'present',
  charset => 'latin1',
}
database { 'testdb':
  ensure  => 'present',
  charset => 'utf8',
}

After hours of staring at the problem I could track it down and the nice folks in #puppet told me about pluginsync. The problem for me was, that the plugin half worked (it installed mysql and set the root password) and that’s why I assumed there was something wrong with the plugin or my node declaration. I just dived into puppet and somehow read over the section on pluginsync in the manual. It might be helpful to other newbies to either issue a warning (if it can be done easily) or just put a note into the README.

History

#1 Updated by Ryan Coleman almost 2 years ago

  • Status changed from Unreviewed to In Topic Branch Pending Review
  • Assignee set to Ryan Coleman
  • Branch set to https://github.com/puppetlabs/puppetlabs-mysql/pull/127

Thank you for your very thorough ticket!

I’ve got a pull request in on this and Puppet 3.0 enables pluginsync by default.

Cheers!

—Ryan

#2 Updated by William Van Hevelingen over 1 year ago

  • Status changed from In Topic Branch Pending Review to Merged - Pending Release

Merged in https://github.com/puppetlabs/puppetlabs-mysql/commit/832783040ac30413fd7c0b583b94faaedb7aea95

#3 Updated by William Van Hevelingen over 1 year ago

  • Status changed from Merged - Pending Release to Closed

It was released.

Also available in: Atom PDF