puppetlabs-mysql module still doesn't properly support $datadir?

22 views
Skip to first unread message

Matt W

unread,
Mar 5, 2014, 11:29:07 AM3/5/14
to puppet...@googlegroups.com
It seems like this has been an issue in the past (https://github.com/puppetlabs/puppetlabs-mysql/issues/228https://groups.google.com/forum/#!searchin/puppet-users/mysql/puppet-users/mkQygmpa610/bXIslE9EG4cJ), but I'm not sure its fixed yet. Can anyone show me some demonstration puppet code that will install MySQL and configure it to use /mnt/mysql instead of /var/lib/mysql? Nothing I seem to try works -- the MySQL daemon continues to start up and use /var/lib/mysql. 

The simplest thing that should have worked, I think, is:

node foo {
  file { '/mnt/mysql':
    ensure => directory,
    owner => 'mysql',
    group  => 'mysql',
    notify => Class['mysql::server::service'];
  }
  class { '::mysql::server':
    override_options => {
      'mysqld' => { 'datadir' => '/mnt/mysql', },
    },
    require          => File[$datadir];
  }
  mysql::db { 'foo': }
}


This did create the /mnt/mysql directory, but mysqld still started up using /var/lib/mysql... even though my.cnf clearly pointed to /mnt/mysql.

Ideas?

Reply all
Reply to author
Forward
0 new messages