diff --git a/attributes/default.rb b/attributes/default.rb index f7b2143138f2df023e1134f147d0173fd67b159f..e71c7d07f1fde391a0d5fda60f3ba0d870e46b66 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -13,6 +13,7 @@ default['typo3_site']['repository_hostname'] = '' default['typo3_site']['repository_port'] = 22 default['typo3_site']['download_typo3'] = false default['typo3_site']['typo3_version'] = '6.2' +default['typo3_site']['mysql_version'] = '5.6' default['typo3_site']['deploy_dump'] = '~/site/dump.sql' default['typo3_site']['solr']['init'] = false diff --git a/recipes/default.rb b/recipes/default.rb index dd542c60c33b3576e551449c3cd687fe32020492..b33d7e4f9a9b9843b558f368db4a8b96c609c295 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -292,14 +292,17 @@ end ################### mysql_service 'default' do - version '5.6' + version node['typo3_site']['mysql_version'] initial_root_password 'root' action [:create, :start] end -mysql_config 'default' do - source 'my.cnf.erb' - action :create +# overwrite the configuration only for MySQL 5.6 (disables the strict checks) +if node['typo3_site']['mysql_version'] === '5.6' + mysql_config 'default' do + source "my-#{node['typo3_site']['mysql_version']}.cnf.erb" + action :create + end end mysql_client 'default' do @@ -359,22 +362,14 @@ node['typo3_site']['sync_databases'].each do |database_data| action :run end - # load the dump - bash 'Import Dump for ' + database_data['database_name'] do - code <<-EOF - mysql -h 127.0.0.1 -u root -proot #{database_data['database_name']} < #{database_data['dump_local']} - EOF - action :run + # this would be better, but currently buggy in the database cookbook + # https://github.com/opscode-cookbooks/database/issues/128 + mysql_database 'Import Dump for ' + database_data['database_name'] do + connection connection_info + database_name database_data['database_name'] + sql { ::File.open(database_data['dump_local']).read } + action :query end - - # # this would be better, but currently buggy in the database cookbook - # # https://github.com/opscode-cookbooks/database/issues/128 - # mysql_database 'Import Dump for ' + database_data['database_name'] do - # connection connection_info - # database_name #{database_data['database_name']} - # sql { ::File.open(#{database_data['dump_local']}).read } - # action :query - # end end if database_data['post_install_queries'] diff --git a/templates/default/my.cnf.erb b/templates/default/my-5.6.cnf.erb similarity index 100% rename from templates/default/my.cnf.erb rename to templates/default/my-5.6.cnf.erb