From: Tom Hughes Date: Sat, 25 Feb 2017 19:25:34 +0000 (+0000) Subject: Make sure chef mysql configuration overrides defaults X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/c4817c654797638bf16b54f4f9b69ed3715625cb Make sure chef mysql configuration overrides defaults --- diff --git a/cookbooks/mysql/recipes/default.rb b/cookbooks/mysql/recipes/default.rb index 49087e67a..07835e729 100644 --- a/cookbooks/mysql/recipes/default.rb +++ b/cookbooks/mysql/recipes/default.rb @@ -25,7 +25,18 @@ service "mysql" do supports :status => true, :restart => true end -template "/etc/mysql/conf.d/chef.cnf" do +file "/etc/mysql/conf.d/chef.cnf" do + action :delete + notifies :restart, "service[mysql]" +end + +conf_file = if node[:lsb][:release].to_f >= 16.04 + "/etc/mysql/mysql.conf.d/zzz-chef.cnf" + else + "/etc/mysql/conf.d/zzz-chef.cnf" + end + +template conf_file do source "my.cnf.erb" owner "root" group "root"