Merge pull request #789 from elconas/fix_mysql576_pull_rebase3

(MODULES-2676) Fixed new mysql_datadir provider on CentOS for MySQl 5.7.6 compatibility
This commit is contained in:
Jesse Lovelace 2015-12-18 09:57:11 -06:00
commit 58a55ade47
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' }} }}