Skip to content

Commit

Permalink
Allow sqldumpoptions to be set using an array
Browse files Browse the repository at this point in the history
  • Loading branch information
Saford91 committed Oct 19, 2016
1 parent cc6bfd1 commit d696461
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
3 changes: 2 additions & 1 deletion manifests/mysql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand All @@ -25,6 +25,7 @@
$backupdir = false,
$hotcopy = false,
$sqldump = false,
$sqldumpoptions = '',
$compress = false,
$configfile = true,
$vsname = false,
Expand Down
13 changes: 12 additions & 1 deletion templates/mysql.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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' %>

0 comments on commit d696461

Please sign in to comment.