Skip to content

Commit 1883f91

Browse files
Mark Learyeputnam
Mark Leary
authored andcommitted
Add prescript support to mysqldump provider
1 parent e56606d commit 1883f91

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Diff for: manifests/server/backup.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
# @param maxallowedpacket
5454
# Defines the maximum SQL statement size for the backup dump script. The default value is 1MB, as this is the default MySQL Server value.
5555
# @param optional_args
56-
# Specifies an array of optional arguments which should be passed through to the backup tool. (Currently only supported by the xtrabackup provider.)
56+
# Specifies an array of optional arguments which should be passed through to the backup tool. (Supported by the xtrabackup and mysqldump providers.)
5757
#
5858
class mysql::server::backup (
5959
$backupuser = undef,

Diff for: templates/mysqlbackup.sh.erb

+5
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ echo "[client]\npassword=$PASS\nuser=$USER\nmax_allowed_packet=$MAX_ALLOWED_PACK
2828
echo -e "[client]\npassword=$PASS\nuser=$USER\nmax_allowed_packet=$MAX_ALLOWED_PACKET" > $TMPFILE
2929
<%- end -%>
3030

31+
<% if @prescript -%>
32+
<%- [@prescript].flatten.compact.each do |script|%>
33+
<%= script %>
34+
<%- end -%>
35+
<% end -%>
3136

3237
# Ensure backup directory exist.
3338
mkdir -p $DIR

0 commit comments

Comments
 (0)