projects
/
chef.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
f12949b
)
Make sure chef mysql configuration overrides defaults
author
Tom Hughes
<tom@compton.nu>
Sat, 25 Feb 2017 19:25:34 +0000
(19:25 +0000)
committer
Tom Hughes
<tom@compton.nu>
Sat, 25 Feb 2017 19:25:34 +0000
(19:25 +0000)
cookbooks/mysql/recipes/default.rb
patch
|
blob
|
history
diff --git
a/cookbooks/mysql/recipes/default.rb
b/cookbooks/mysql/recipes/default.rb
index 49087e67a1b78d7a2dacfb1f1377042d4438d1b2..07835e729908255066921f67fa3c2a97eda69e4a 100644
(file)
--- 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"