From 9570b0342fb0710b8c346294312f42fa9af0436d Mon Sep 17 00:00:00 2001 From: Quentin Moss Date: Tue, 19 Jul 2016 17:44:28 -0700 Subject: [PATCH] MODULES-3601 Move binary logging configuration to take place after package install --- manifests/server.pp | 2 ++ manifests/server/binarylog.pp | 22 ++++++++++++++++++++++ manifests/server/config.pp | 16 ---------------- 3 files changed, 24 insertions(+), 16 deletions(-) create mode 100644 manifests/server/binarylog.pp diff --git a/manifests/server.pp b/manifests/server.pp index 4709845..e910c21 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -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'] -> diff --git a/manifests/server/binarylog.pp b/manifests/server/binarylog.pp new file mode 100644 index 0000000..79d6c6e --- /dev/null +++ b/manifests/server/binarylog.pp @@ -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'], + } + } + } +} diff --git a/manifests/server/config.pp b/manifests/server/config.pp index 0d70fd1..efb4940 100644 --- a/manifests/server/config.pp +++ b/manifests/server/config.pp @@ -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,