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