diff --git a/manifests/mysql.pp b/manifests/mysql.pp index e3793a5..1ffd822 100644 --- a/manifests/mysql.pp +++ b/manifests/mysql.pp @@ -10,7 +10,7 @@ # that we can find the correct file to remove). # # user, dbusername, dbpassword, dbhost, databases, backupdir, -# hotcopy, sqldump, compress, configfile: As defined in the +# hotcopy, sqldump, sqldumpoptions, compress, configfile: As defined in the # backupninja documentation, with the caveat that hotcopy, sqldump, # and compress take true/false rather than yes/no. # @@ -25,6 +25,7 @@ $backupdir = false, $hotcopy = false, $sqldump = false, + $sqldumpoptions = '', $compress = false, $configfile = true, $vsname = false, diff --git a/templates/mysql.conf.erb b/templates/mysql.conf.erb index 575d04e..b9c4761 100644 --- a/templates/mysql.conf.erb +++ b/templates/mysql.conf.erb @@ -28,5 +28,16 @@ configfile = <%= @real_configfile %> <% end -%> hotcopy = <%= @hotcopy ? 'yes' : 'no' %> -sqldump = <%= @sqldump ? 'yes' : 'no' %> + +<% if @sqldump -%> +sqldump = yes +<% if @sqldumpoptions.is_a? String -%> +<%= 'sqldumpoptions = ' + @sqldumpoptions %> +<% elsif @sqldumpoptions.is_a? Array -%> +<%= 'sqldumpoptions = ' + @sqldumpoptions.map { |i| "#{i}" }.join(" ") %> +<% end -%> +<% else -%> +sqldump = no +<% end -%> + compress = <%= @compress ? 'yes' : 'no' %>