bflad / chef-stash

Chef Cookbook for Atlassian Stash
Other
37 stars 42 forks source link

Cannot install mysql-client 5.6 on Ubuntu 12.04 #111

Closed linc01n closed 9 years ago

linc01n commented 9 years ago

For ubuntu 12.04 LTS, the kitchen test failed because it cannot install mysql client 5.6.

http://packages.ubuntu.com/search?keywords=mysql-client

/cc @patcon

patcon commented 9 years ago

Hm. 5.5 has more support and might be more widely available, if we want the simplest solution (ie not changing mysql version between platforms)

linc01n commented 9 years ago

Do we need to specify the version here? https://github.com/bflad/chef-stash/blob/master/recipes/database.rb#L11

I don't think we should handle the mysql version ourself. Let the mysql cookbook handles it.

patcon commented 9 years ago

The mysql2_chef_gem isn't aware of the mysql cookbook's preferences, so it needs to be piped in there so that the mysql2_chef_gem resource installs the correct mysql-client package that gem is linked against (I believe).

We could totally ignore the mysql_client and mysql_service version, but since mysql service version is now a resource attr, we need to allow the user the ability to set it somewhere in our cookbook, or else they are stuck with the defaults without hacking up the cookbook

How about we set default['stash]['database']['version'] = nil and use this:

  mysql2_chef_gem 'default' do
    client_version settings['database']['version'] if settings['database']['version']
    action :install
  end

  mysql_service 'default' do
    version settings['database']['version'] if settings['database']['version']
    bind_address settings['database']['host']
    # See: https://github.com/chef-cookbooks/mysql/pull/361
    port settings['database']['port'].to_s
    data_dir node['mysql']['data_dir'] if node['mysql']['data_dir']
    initial_root_password node['mysql']['server_root_password']
    action [:create, :start]
  end
patcon commented 9 years ago

Haven't tested the above commit that reflects that comment.

Not that the platforms highlighted in this link (should we choose to add them later), will def be broken because 5.0 and 5.1 are not supported: https://github.com/chef-cookbooks/mysql/blob/v6.0.26/libraries/helpers.rb#L414-L417

patcon commented 9 years ago

But having just submitted that commit above, I'm actually inclined to use the first approach of just hardcoding 5.5, as that's what stash supports (along with 5.6.16+). If and when that approach breaks, we could then do some settings hash magic (like we do for database port) to select the right database version.

patcon commented 9 years ago

:+1: :)