Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added a case statement to include executing manage_dirs on the class config only for Debian, because there's dependency of Debian tool unless => "/usr/bin/dpkg -s ${mysql::server::package_name}", Created the parameter managed_dirs for the class mysql::server to allow use the class mysql::server::managed_dirs * Updated REFERENCES for the new parameter managed_dirs. * Added a default case for the case statement of managing dirs for Debian in mysql::server::config * Fixed a default value for the parameter $managed_dirs from undef to $mysql::params::managed_dirs. Updated REFERENCE.md * (maint) Add tests to verify mariadb Co-authored-by: Eugeny Kisel <ekisel@objectstyle.com> Co-authored-by: sheena <sheena@puppet.com>
- Loading branch information
1 parent
ddca3f9
commit 6af116c
Showing
4 changed files
with
71 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
require 'spec_helper_acceptance' | ||
|
||
describe 'mysql server class', if: ((os[:family] == 'debian' && os[:release].to_i > 8) || (os[:family] == 'redhat' && os[:release].to_i > 6)) do | ||
describe 'mariadb' do | ||
let(:pp) do | ||
<<-MANIFEST | ||
$osname = $facts['os']['name'].downcase | ||
yumrepo {'mariadb': | ||
baseurl => "http://yum.mariadb.org/10.4/$osname${facts['os']['release']['major']}-aarch64/", | ||
gpgkey => 'https://yum.mariadb.org/RPM-GPG-KEY-MariaDB', | ||
descr => "MariaDB 10.4", | ||
enabled => 1, | ||
gpgcheck => 1, | ||
}-> | ||
class { '::mysql::server': | ||
require => Yumrepo['mariadb'], | ||
package_name => 'mariadb-server', | ||
service_name => 'mariadb', | ||
root_password => 'strongpassword', | ||
remove_default_accounts => true, | ||
managed_dirs => ['/var/log','/var/run/mysql'], | ||
override_options => { | ||
mysqld => { | ||
log-error => '/var/log/mariadb.log', | ||
pid-file => '/var/run/mysql/mysqld.pid', | ||
}, | ||
mysqld_safe => { | ||
log-error => '/var/log/mariadb.log', | ||
}, | ||
}, | ||
} | ||
MANIFEST | ||
end | ||
|
||
it 'apply manifest' do | ||
apply_manifest(pp) | ||
end | ||
it 'mariadb connection' do | ||
result = run_shell('mysql --user="root" --password="strongpassword" -e "status"') | ||
expect(result.stdout).to match(%r{MariaDB}) | ||
expect(result.stderr).to be_empty | ||
end | ||
end | ||
end |