Skip to content

Commit

Permalink
Mapping platform 'redhat' to 'rhel' for redhat platform
Browse files Browse the repository at this point in the history
Default yum repo of mariadb on http://yum.mariadb.org/ uses 'rhel' for
redhat platform, but ohai returns node['platform'] as 'redhat'. Needs to
do the mapping in repository.rb

Fix some rubocop issues.
  • Loading branch information
yinym committed Feb 16, 2015
1 parent 1a93b6c commit 4240467
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
5 changes: 2 additions & 3 deletions recipes/_redhat_galera.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
# limitations under the License.
#

#To force removing of mariadb-libs on CentOS >= 7
# To force removing of mariadb-libs on CentOS >= 7
package 'MariaDB-shared' do
action:install
action :install
end


package 'MariaDB-Galera-server' do
action :install
notifies :create, 'directory[/var/log/mysql]', :immediately
Expand Down
4 changes: 2 additions & 2 deletions recipes/_redhat_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
# limitations under the License.
#

#To force removing of mariadb-libs on CentOS >= 7
# To force removing of mariadb-libs on CentOS >= 7
package 'MariaDB-shared' do
action:install
action :install
end

package 'MariaDB-server' do
Expand Down
7 changes: 6 additions & 1 deletion recipes/repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,15 @@
when 'yum'
include_recipe 'yum::default'

if node['platform'] == 'redhat'
target_platform = "rhel#{node['platform_version'].to_i}"
else
target_platform = "#{node['platform']}#{node['platform_version'].to_i}"
end
yum_repository "mariadb-#{node['mariadb']['install']['version']}" do
description 'MariaDB Official Repository'
baseurl 'http://yum.mariadb.org/' + \
node['mariadb']['install']['version'] + "/#{node['platform']}#{node['platform_version'].to_i}-amd64"
node['mariadb']['install']['version'] + "/#{target_platform}-amd64"
gpgkey 'https://yum.mariadb.org/RPM-GPG-KEY-MariaDB'
action :create
end
Expand Down

0 comments on commit 4240467

Please sign in to comment.