Skip to content
Snippets Groups Projects
Commit dae2f00d authored by Stefan Galinski's avatar Stefan Galinski :video_game:
Browse files

[FEATURE] Allow the configuration of the mysql version

parent b3caaca1
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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']
......
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment