MODULES-3601 Move binary logging configuration to take place after package install

This commit is contained in:
Quentin Moss 2016-07-19 17:44:28 -07:00
parent 7bade11b43
commit 9570b0342f
No known key found for this signature in database
GPG key ID: E17DF46851B25AE2
3 changed files with 24 additions and 16 deletions

View file

@ -55,6 +55,7 @@ class mysql::server (
include '::mysql::server::config'
include '::mysql::server::install'
include '::mysql::server::binarylog'
include '::mysql::server::installdb'
include '::mysql::server::service'
include '::mysql::server::root_password'
@ -77,6 +78,7 @@ class mysql::server (
Anchor['mysql::server::start'] ->
Class['mysql::server::config'] ->
Class['mysql::server::install'] ->
Class['mysql::server::binarylog'] ->
Class['mysql::server::installdb'] ->
Class['mysql::server::service'] ->
Class['mysql::server::root_password'] ->

View 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'],
}
}
}
}

View file

@ -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 {
file { 'mysql-config-file':
path => $mysql::server::config_file,