]> git.openstreetmap.org Git - chef.git/commitdiff
Make sure chef mysql configuration overrides defaults
authorTom Hughes <tom@compton.nu>
Sat, 25 Feb 2017 19:25:34 +0000 (19:25 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 25 Feb 2017 19:25:34 +0000 (19:25 +0000)
cookbooks/mysql/recipes/default.rb

index 49087e67a1b78d7a2dacfb1f1377042d4438d1b2..07835e729908255066921f67fa3c2a97eda69e4a 100644 (file)
@@ -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"