Merge pull request #868 from QuentinMoss/fix-binarylog-order
MODULES-3601 Move binary logging configuration to take place after pa…
This commit is contained in:
commit
bc2a90261c
3 changed files with 24 additions and 16 deletions
|
@ -55,6 +55,7 @@ class mysql::server (
|
||||||
|
|
||||||
include '::mysql::server::config'
|
include '::mysql::server::config'
|
||||||
include '::mysql::server::install'
|
include '::mysql::server::install'
|
||||||
|
include '::mysql::server::binarylog'
|
||||||
include '::mysql::server::installdb'
|
include '::mysql::server::installdb'
|
||||||
include '::mysql::server::service'
|
include '::mysql::server::service'
|
||||||
include '::mysql::server::root_password'
|
include '::mysql::server::root_password'
|
||||||
|
@ -77,6 +78,7 @@ class mysql::server (
|
||||||
Anchor['mysql::server::start'] ->
|
Anchor['mysql::server::start'] ->
|
||||||
Class['mysql::server::config'] ->
|
Class['mysql::server::config'] ->
|
||||||
Class['mysql::server::install'] ->
|
Class['mysql::server::install'] ->
|
||||||
|
Class['mysql::server::binarylog'] ->
|
||||||
Class['mysql::server::installdb'] ->
|
Class['mysql::server::installdb'] ->
|
||||||
Class['mysql::server::service'] ->
|
Class['mysql::server::service'] ->
|
||||||
Class['mysql::server::root_password'] ->
|
Class['mysql::server::root_password'] ->
|
||||||
|
|
22
manifests/server/binarylog.pp
Normal file
22
manifests/server/binarylog.pp
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
# Binary log configuration requires the mysql user to be present. This must be done after package install
|
||||||
|
class mysql::server::binarylog {
|
||||||
|
|
||||||
|
$options = $mysql::server::options
|
||||||
|
$includedir = $mysql::server::includedir
|
||||||
|
|
||||||
|
$logbin = pick($options['mysqld']['log-bin'], $options['mysqld']['log_bin'], false)
|
||||||
|
|
||||||
|
if $logbin {
|
||||||
|
$logbindir = mysql_dirname($logbin)
|
||||||
|
|
||||||
|
#Stop puppet from managing directory if just a filename/prefix is specified
|
||||||
|
if $logbindir != '.' {
|
||||||
|
file { $logbindir:
|
||||||
|
ensure => directory,
|
||||||
|
mode => '0755',
|
||||||
|
owner => $options['mysqld']['user'],
|
||||||
|
group => $options['mysqld']['user'],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -29,22 +29,6 @@ class mysql::server::config {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$logbin = pick($options['mysqld']['log-bin'], $options['mysqld']['log_bin'], false)
|
|
||||||
|
|
||||||
if $logbin {
|
|
||||||
$logbindir = mysql_dirname($logbin)
|
|
||||||
|
|
||||||
#Stop puppet from managing directory if just a filename/prefix is specified
|
|
||||||
if $logbindir != '.' {
|
|
||||||
file { $logbindir:
|
|
||||||
ensure => directory,
|
|
||||||
mode => '0755',
|
|
||||||
owner => $options['mysqld']['user'],
|
|
||||||
group => $options['mysqld']['user'],
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if $mysql::server::manage_config_file {
|
if $mysql::server::manage_config_file {
|
||||||
file { 'mysql-config-file':
|
file { 'mysql-config-file':
|
||||||
path => $mysql::server::config_file,
|
path => $mysql::server::config_file,
|
||||||
|
|
Loading…
Reference in a new issue