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

Bug #15632

puppetlabs-mysql doesn't set service_name completely

Added by Tom Seeley about 2 years ago. Updated over 1 year ago.

Status:ClosedStart date:07/20/2012
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:mysqlSpent time:-
Target version:-
Keywords: Branch:

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

I’m trying to use the above module to install and manage mysql server on redhat/centos 6 using the mysql 5.5 rpm from mysql.com. This package uses a different package and service name than the one distrubted with redhat/centos.

I have set the following in my nodes.pp:

    class { 'mysql::server':
      service_name => 'mysql',
      config_hash => { 'root_password' => 'foo' },
      package_name => 'MySQL-server',
    }

This causes the correct package to be installed, the correct service name is used to start the service and the root password to be set correctly. Unfortunately the service restart that is triggered when /root/.my.cnf is changed fails when it trys to restart ‘mysqld’, which is not the correct service name. From the agent log:

[root@puppetclient ~]# puppet agent --no-daemonize --verbose
notice: Starting Puppet client version 2.6.16
info: Caching catalog for puppetclient.tomtest.com
info: Applying configuration version '1342797246'
notice: /Stage[main]/Mysql::Server/Package[mysql-server]/ensure: created
notice: /Stage[main]/Mysql::Server/Service[mysqld]/ensure: ensure changed 'stopped' to 'running'
notice: /File[/etc/my.cnf]/ensure: defined content as '{md5}ba6ceaae89ed97c034ddfb9a21bce30f'
info: /File[/etc/my.cnf]: Scheduling refresh of Exec[mysqld-restart]
notice: /File[/etc/mysql]/ensure: created
info: /File[/etc/mysql]: Scheduling refresh of Exec[mysqld-restart]
notice: /File[/etc/mysql/conf.d]/ensure: created
info: /File[/etc/mysql/conf.d]: Scheduling refresh of Exec[mysqld-restart]
notice: /Stage[main]/Mysql::Config/Exec[set_mysql_rootpw]/returns: executed successfully
info: /Stage[main]/Mysql::Config/Exec[set_mysql_rootpw]: Scheduling refresh of Exec[mysqld-restart]
notice: /File[/root/.my.cnf]/ensure: defined content as '{md5}ceb4f7ac6eba1f5ffb9631c80ef2b436'
info: /File[/root/.my.cnf]: Scheduling refresh of Exec[mysqld-restart]
notice: /Stage[main]/Mysql::Config/Exec[mysqld-restart]/returns: mysqld: unrecognized service
err: /Stage[main]/Mysql::Config/Exec[mysqld-restart]: Failed to call refresh: service mysqld restart returned 1 instead of one of [0] at /etc/puppet/environments/test/modules/mysql/manifests/config.pp:78
notice: Finished catalog run in 34.13 seconds

History

#1 Updated by Ryan Coleman almost 2 years ago

  • Status changed from Unreviewed to Closed

I think this is resolved with the module using the same variable throughout to set the service name. Please let us know if that’s not the case.

#2 Updated by Trung Hoang over 1 year ago

I’ve found that the only way I could get this to work is to specify service_name it both at the class level and inside the config_hash.

class { 'mysql::server':
  package_name => 'Percona-Server-server-55',
  service_name => 'mysql',
  config_hash => {
    'root_password' => 'some-root-pass',
    'service_name' => 'mysql',
  }
  require => File['/var/run/mysqld'],
}

Quite odd.. is this by design as it’s not very DRY?

Also available in: Atom PDF