diff --git a/attributes/server.rb b/attributes/server.rb index c48d2cf7a..03cad74ed 100644 --- a/attributes/server.rb +++ b/attributes/server.rb @@ -178,6 +178,7 @@ default['mysql']['tunable']['sync_binlog'] = 0 default['mysql']['tunable']['skip_slave_start'] = false +default['mysql']['tunable']['read_only'] = false default['mysql']['tunable']['log_error'] = nil default['mysql']['tunable']['log_warnings'] = false diff --git a/templates/default/my.cnf.erb b/templates/default/my.cnf.erb index aaa7754c5..b274ea0ea 100644 --- a/templates/default/my.cnf.erb +++ b/templates/default/my.cnf.erb @@ -185,6 +185,9 @@ sync_binlog = <%= node['mysql']['tunable']['sync_binlog'] %> <%- if node['mysql']['tunable']['skip_slave_start'] %> skip_slave_start <%- end %> +<%- if node['mysql']['tunable']['read_only'] %> +read_only = 1 +<%- end %> <%- if node['mysql']['tunable']['transaction-isolation'] %> transaction-isolation = <%= node['mysql']['tunable']['transaction-isolation'] %>