# HG changeset patch # User IBBoard # Date 1425859102 0 # Node ID aa40b53324e46836e434b1363eae5f29d0ef8677 # Parent ccca5d75111f9247431b5d7e20af3967088e5149 Make MySQL Website class more flexible for supporting MariaDB diff -r ccca5d75111f -r aa40b53324e4 modules/website/manifests/mysql.pp --- a/modules/website/manifests/mysql.pp Sun Mar 08 23:57:04 2015 +0000 +++ b/modules/website/manifests/mysql.pp Sun Mar 08 23:58:22 2015 +0000 @@ -3,10 +3,11 @@ $mysqlpassword, $mysqlsuffix = '', $phpsuffix = '', - $phpmysqlsuffix = '') + $phpmysqlsuffix = '', + $mysqlprefix = 'mysql') { class { 'mysql::client': - package_name => "mysql${mysqlsuffix}", + package_name => "${mysqlprefix}${mysqlsuffix}", bindings_enable => false, #Deal with bindings manually } class { 'mysql::bindings': @@ -14,7 +15,7 @@ php_package_name => "php${phpsuffix}-mysql${phpmysqlsuffix}", } class { 'mysql::server': - package_name => "mysql${mysqlsuffix}-server", + package_name => "${mysqlprefix}${mysqlsuffix}-server", override_options => { 'mysqld' => { 'query_cache_size' => '32M', @@ -25,12 +26,12 @@ 'log-queries-not-using-indexes' => '1', } }, - require => File['/var/log/mysql/'] } file { '/var/log/mysql': ensure => directory, owner => 'mysql', group => 'mysql', + require => Class['mysql::server'], } $username = strip($mysqluser) $password = strip($mysqlpassword) @@ -38,6 +39,7 @@ exec { 'Rename root MySQL user for security': command => "mysql -uroot -e 'UPDATE mysql.user SET User = \"$username\", Password = PASSWORD(\"$password\") WHERE User = \"root\"; DELETE FROM mysql.user WHERE User = ''; FLUSH PRIVILEGES;' && touch $configured_marker", provider => shell, - creates => $configured_marker + creates => $configured_marker, + require => Class['mysql::server'], } }