Skip to content

Commit 33c655c

Browse files
committed
Added include/exclude support
1 parent 8dccd06 commit 33c655c

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

manifests/client.pp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
class rsnapshot::client (
3939
$server,
4040
$directories = {},
41+
$includes = {},
42+
$excludes = {},
43+
$include_files = {},
44+
$exclude_files = {},
4145
$user = $rsnapshot::params::client_user,
4246
$remote_user = $rsnapshot::params::server_user,
4347
$backup_hourly_cron = $rsnapshot::params::backup_hourly_cron,
@@ -89,6 +93,10 @@
8993
server => $server,
9094
user => $user,
9195
directories => $directories,
96+
includes => $includes,
97+
excludes => $excludes,
98+
include_files => $include_files,
99+
exclude_files => $exclude_files,
92100
backup_hourly_cron => $backup_hourly_cron,
93101
backup_time_minute => $backup_time_minute,
94102
backup_time_hour => $backup_time_hour,

manifests/server/config.pp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55
$backup_user = undef,
66
$directories = {},
77
$lock_path = undef,
8+
$includes = {},
9+
$excludes = {},
10+
$include_files = {},
11+
$exclude_files = {},
12+
$config_path = undef,
13+
$log_path = undef,
14+
$lock_path = undef,
815
$remote_user = undef,
916
$no_create_root = undef,
1017
$verbose = undef,

templates/config.erb

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,34 @@ retain monthly <%= @retain_monthly %>
6868
<% end -%>
6969

7070

71+
##############################
72+
### INCLUDE / EXCUDE FILES ###
73+
##############################
74+
75+
<% @includes.each do |value| -%>
76+
<%- if value.to_s != 'undef' -%>
77+
include <%= value %>
78+
<%- end -%>
79+
<% end -%>
80+
81+
<% @excludes.each do |value| -%>
82+
<%- if value.to_s != 'undef' -%>
83+
exclude <%= value %>
84+
<%- end -%>
85+
<% end -%>
86+
87+
<% @include_files.each do |value| -%>
88+
<%- if value.to_s != 'undef' -%>
89+
include <%= value %>
90+
<%- end -%>
91+
<% end -%>
92+
93+
<% @exclude_files.each do |value| -%>
94+
<%- if value.to_s != 'undef' -%>
95+
exclude <%= value %>
96+
<%- end -%>
97+
<% end -%>
98+
7199
###############################
72100
### BACKUP POINTS / SCRIPTS ###
73101
###############################

0 commit comments

Comments
 (0)