module-puppetlabs-mysql/manifests/server.pp
Dan Bode fb00c75ced Debian should not manage root password
- previously setting the root password failed on 
  Debian b/c a root password was already set
  during package installation
- Debian already installs mysql with a 
   maintainance user capable of performing any
   required database actions.
- this patch splits setting of root password to
  be redhat specific.
- as a consequence, users will not be able to 
  specify a root password on Debian (which 
  needs to be opened as a seperate ticket)
2011-06-16 10:49:15 -07:00

59 lines
1.5 KiB
Puppet

# Class: mysql::server
#
# manages the installation of the mysql server.
# manages the package, service, my.cnf
#
# Parameters:
# [*root_password*] - root password for database
# [*old_root_password*] - previous root password if being changed
# [*service_name*] - name of service
# [*package_name*] - name of package
#
# Actions:
#
# Requires:
#
# Sample Usage:
#
class mysql::server(
$service_name = $mysql::params::service_name,
$root_password = undef,
$old_root_password = undef,
$package_name = 'mysql-server'
) inherits mysql::params {
case $operatingsystem {
'centos', 'redhat', 'fedora': {
class { 'mysql::server::redhat':
root_password => $root_password,
old_root_password => $old_root_password,
}
}
'ubuntu', 'debian': {
# there is not any debian specific config yet
}
}
package{'mysql-server':
name => $package_name,
ensure => present,
notify => Service['mysqld'],
}
service { 'mysqld':
name => $service_name,
ensure => running,
enable => true,
}
# this kind of sucks, that I have to specify a difference resource for restart.
# the reason is that I need the service to be started before mods to the config
# file which can cause a refresh
exec{ 'mysqld-restart':
command => "/usr/sbin/service ${service_name} restart",
refreshonly => true,
}
File{
owner => 'mysql',
group => 'mysql',
require => Package['mysql-server'],
}
}