module-puppetlabs-mysql/manifests/server/service.pp
Sebastian Reitenbach 5116883111 Fix regression introduced by adding OpenBSD support.
Add a $mysql_group parameter, and use that instead of the $root_group
parameter to define the group membership of the mysql error log file.
2015-03-18 08:47:25 +01:00

41 lines
1.1 KiB
Puppet

#
class mysql::server::service {
$options = $mysql::server::options
if $mysql::server::real_service_manage {
if $mysql::server::real_service_enabled {
$service_ensure = 'running'
} else {
$service_ensure = 'stopped'
}
} else {
$service_ensure = undef
}
if $mysql::server::override_options['mysqld'] and $mysql::server::override_options['mysqld']['user'] {
$mysqluser = $mysql::server::override_options['mysqld']['user']
} else {
$mysqluser = $options['mysqld']['user']
}
file { $options['mysqld']['log-error']:
ensure => present,
owner => $mysqluser,
group => $::mysql::server::mysql_group,
}
service { 'mysqld':
ensure => $service_ensure,
name => $mysql::server::service_name,
enable => $mysql::server::real_service_enabled,
provider => $mysql::server::service_provider,
require => Package['mysql-server'],
}
# only establish ordering between config file and service if
# we're managing the config file.
if $mysql::server::manage_config_file {
File['mysql-config-file'] -> Service['mysqld']
}
}