From bc6636665f248f3a988ef06ce95ec93b9e1f9f8f Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Mon, 6 Jul 2015 15:38:22 -0400 Subject: [PATCH] Upgrade mysql cookbook to 6.x. [#103] --- attributes/default.rb | 1 + metadata.rb | 2 +- recipes/database.rb | 11 +++++++++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/attributes/default.rb b/attributes/default.rb index d657e23..973b8db 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -182,6 +182,7 @@ default['stash']['backup_client']['cron']['month'] = '*' default['stash']['backup_client']['cron']['weekday'] = '*' +default['stash']['database']['version'] = '5.6' default['stash']['database']['host'] = 'localhost' default['stash']['database']['name'] = 'stash' default['stash']['database']['password'] = 'changeit' diff --git a/metadata.rb b/metadata.rb index 0dab333..8c40b0c 100644 --- a/metadata.rb +++ b/metadata.rb @@ -27,7 +27,7 @@ depends 'database' depends 'git' depends 'java' -depends 'mysql', '~> 5.0' +depends 'mysql', '~> 6.0' depends 'mysql2_chef_gem' depends 'mysql_connector' depends 'perl' diff --git a/recipes/database.rb b/recipes/database.rb index 81660eb..c4d5007 100644 --- a/recipes/database.rb +++ b/recipes/database.rb @@ -7,12 +7,19 @@ case settings['database']['type'] when 'mysql' - include_recipe 'mysql::server' - mysql2_chef_gem 'default' do action :install end + mysql_service 'default' do + version settings['database']['version'] + bind_address settings['database']['host'] + port '3306' + data_dir node['mysql']['data_dir'] if node['mysql']['data_dir'] + initial_root_password node['mysql']['server_root_password'] + action [:create, :start] + end + database_connection.merge!(:username => 'root', :password => node['mysql']['server_root_password']) mysql_database settings['database']['name'] do