Skip to content

Commit

Permalink
Fix mariadbbackup_pkg_name helper for yum
Browse files Browse the repository at this point in the history
The name of the MariaDB-backup package on yum-based repos is
case-sensitive and has capitals in the name, much like the server
package name.

Fixes sous-chefs#276
  • Loading branch information
ccrebolder committed Oct 18, 2019
1 parent 6a94eb1 commit 466dde5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p

### Fixed

- Fixed `mariadbbackup_pkg_name` helper for yum-based platforms ([#276](https://github.com/sous-chefs/mariadb/issues/276))
- Fixed replication resource `load_current_value` to use Integers where required
- Make `server_configuration` and `server_install` resources idempotent ([#265](https://github.com/sous-chefs/mariadb/issues/265))

Expand Down
11 changes: 8 additions & 3 deletions libraries/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,15 @@ def secure_random
end

def mariadbbackup_pkg_name
if new_resource.version == '10.3'
'mariadb-backup'
case node['platform_family']
when 'rhel', 'fedora', 'amazon'
'MariaDB-backup'
else
"mariadb-backup-#{new_resource.version}"
if new_resource.version == '10.3'
'mariadb-backup'
else
"mariadb-backup-#{new_resource.version}"
end
end
end

Expand Down
6 changes: 6 additions & 0 deletions test/cookbooks/test/recipes/galera_configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
version '10.3'
end

yum_repository 'epel' do
mirrorlist "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-#{node['platform_version'].to_i}&arch=$basearch"
gpgkey "https://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-#{node['platform_version'].to_i}"
only_if { platform?('centos') }
end

mariadb_galera_configuration 'MariaDB Galera Configuration' do
version '10.3'
wsrep_sst_method 'mariabackup'
Expand Down

0 comments on commit 466dde5

Please sign in to comment.