Make service restarts optional

Useful if you prefer to not have your mysql service touched after it is
running.
This commit is contained in:
Mikael Fridh 2012-09-08 12:09:44 +02:00
parent d98efe3b7a
commit af58059903
2 changed files with 11 additions and 3 deletions

View file

@ -46,14 +46,18 @@ class mysql::config(
$ssl_key = $mysql::params::ssl_key,
$log_error = $mysql::params::log_error,
$default_engine = 'UNSET',
$root_group = $mysql::params::root_group
$root_group = $mysql::params::root_group,
$restart = $mysql::params::restart
) inherits mysql::params {
File {
owner => 'root',
group => $root_group,
mode => '0400',
notify => Exec['mysqld-restart'],
notify => $restart ? {
true => Exec['mysqld-restart'],
false => undef,
},
}
if $ssl and $ssl_ca == undef {
@ -90,7 +94,10 @@ class mysql::config(
logoutput => true,
unless => "mysqladmin -u root -p'${root_password}' status > /dev/null",
path => '/usr/local/sbin:/usr/bin:/usr/local/bin',
notify => Exec['mysqld-restart'],
notify => $restart ? {
true => Exec['mysqld-restart'],
false => undef,
},
require => File['/etc/mysql/conf.d'],
}

View file

@ -16,6 +16,7 @@ class mysql::params {
$port = 3306
$etc_root_password = false
$ssl = false
$restart = true
case $::operatingsystem {
'Ubuntu': {