Fixed new mysql_datadir provider on CentOS for MySQl 5.7.6 compatibility

This commit is contained in:
Robert Heinzmann 2015-12-17 18:31:17 +01:00
parent 45419fde6d
commit 7efc93c3c5
3 changed files with 21 additions and 0 deletions

View file

@ -2,6 +2,10 @@ class Puppet::Provider::Mysql < Puppet::Provider
# Without initvars commands won't work.
initvars
# Make sure we find mysqld on CentOS
ENV['PATH']=ENV['PATH'] + ':/usr/libexec'
commands :mysql => 'mysql'
commands :mysqld => 'mysqld'
commands :mysqladmin => 'mysqladmin'

View file

@ -3,6 +3,11 @@ Puppet::Type.type(:mysql_datadir).provide(:mysql, :parent => Puppet::Provider::M
desc 'manage data directories for mysql instances'
initvars
# Make sure we find mysqld on CentOS
ENV['PATH']=ENV['PATH'] + ':/usr/libexec'
commands :mysqld => 'mysqld'
commands :mysql_install_db => 'mysql_install_db'

View file

@ -68,6 +68,18 @@ describe 'mysql::server' do
:ensure => :stopped
})
end
context 'with package_manage set to true' do
let(:params) {{ :package_manage => true }}
it { is_expected.to contain_package('mysql-server') }
end
context 'with package_manage set to false' do
let(:params) {{ :package_manage => false }}
it { is_expected.not_to contain_package('mysql-server') }
end
context 'with datadir overridden' do
let(:params) {{ :override_options => { 'mysqld' => { 'datadir' => '/tmp' }} }}
it { is_expected.to contain_mysql_datadir('/tmp') }
end
end
context 'with log-error overridden' do
let(:params) {{ :override_options => { 'mysqld' => { 'log-error' => '/tmp/error.log' }} }}