Skip to content

Commit 6ab951f

Browse files
comport3tphoney
authored andcommitted
Add option to specify $backupdir as a symlink target, for use with dm… (#1200)
* Add option to specify $backupdir as a symlink target, for use with dm_crypt encrypted partitions.
1 parent cad36f0 commit 6ab951f

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

manifests/backup/mysqldump.pp

+18-5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
$postscript = false,
2626
$execpath = '/usr/bin:/usr/sbin:/bin:/sbin',
2727
$optional_args = [],
28+
$mysqlbackupdir_ensure = 'directory',
29+
$mysqlbackupdir_target = undef,
2830
) inherits mysql::params {
2931

3032
if $backupcompress {
@@ -84,10 +86,21 @@
8486
content => template('mysql/mysqlbackup.sh.erb'),
8587
}
8688

87-
file { $backupdir:
88-
ensure => 'directory',
89-
mode => $backupdirmode,
90-
owner => $backupdirowner,
91-
group => $backupdirgroup,
89+
if $mysqlbackupdir_target {
90+
file { $backupdir:
91+
ensure => $mysqlbackupdir_ensure,
92+
target => $mysqlbackupdir_target,
93+
mode => $backupdirmode,
94+
owner => $backupdirowner,
95+
group => $backupdirgroup,
96+
}
97+
} else {
98+
file { $backupdir:
99+
ensure => $mysqlbackupdir_ensure,
100+
mode => $backupdirmode,
101+
owner => $backupdirowner,
102+
group => $backupdirgroup,
103+
}
92104
}
105+
93106
}

0 commit comments

Comments
 (0)