Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ sets up a rsync server
$max_connections - maximum number of simultaneous connections allowed, defaults to 0
$lock_file - file used to support the max connections parameter, defaults to /var/run/rsyncd.lock only needed if max_connections > 0
$secrets_file - path to the file that contains the username:password pairs used for authenticating this module
$dont_compress - list of wildcard patterns for files that should not be compressed by default (man 5 rsyncd.conf for details, must be undef or an array)
$auth_users - list of usernames that will be allowed to connect to this module (must be undef or an array)
$hosts_allow - list of patterns allowed to connect to this module (man 5 rsyncd.conf for details, must be undef or an array)
$hosts_deny - list of patterns allowed to connect to this module (man 5 rsyncd.conf for details, must be undef or an array)
Expand Down
8 changes: 5 additions & 3 deletions manifests/server/module.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@
# $lock_file - file used to support the max connections parameter, defaults to /var/run/rsyncd.lock
# only needed if max_connections > 0
# $secrets_file - path to the file that contains the username:password pairs used for authenticating this module
# $dont_compress - list of wildcard patterns for files that should not be compressed by default (man 5 rsyncd.conf for details, must be undef or an array)
# $auth_users - list of usernames that will be allowed to connect to this module (must be undef or an array)
# $hosts_allow - list of patterns allowed to connect to this module (man 5 rsyncd.conf for details, must be undef or an array)
# $hosts_deny - list of patterns allowed to connect to this module (man 5 rsyncd.conf for details, must be undef or an array)
# $transfer_logging - parameter enables per-file logging of downloads and
# $transfer_logging - parameter enables per-file logging of downloads and
# uploads in a format somewhat similar to that used by ftp daemons.
# $log_format - This parameter allows you to specify the format used
# for logging file transfers when transfer logging is enabled. See the
# $log_format - This parameter allows you to specify the format used
# for logging file transfers when transfer logging is enabled. See the
# rsyncd.conf documentation for more details.
# $refuse_options - list of rsync command line options that will be refused by your rsync daemon.
#
Expand Down Expand Up @@ -53,6 +54,7 @@
$lock_file = '/var/run/rsyncd.lock',
$secrets_file = undef,
$exclude = undef,
$dont_compress = undef,
$auth_users = undef,
$hosts_allow = undef,
$hosts_deny = undef,
Expand Down
8 changes: 8 additions & 0 deletions spec/defines/server_module_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
it { is_expected.to contain_concat__fragment(fragment_name).with_content(/^outgoing chmod\s*=\s*0644$/) }
it { is_expected.to contain_concat__fragment(fragment_name).with_content(/^max connections\s*=\s*0$/) }
it { is_expected.not_to contain_concat__fragment(fragment_name).with_content(/^lock file\s*=.*$/) }
it { is_expected.not_to contain_concat__fragment(fragment_name).with_content(/^dont compress\s*=.*$/) }
it { is_expected.not_to contain_concat__fragment(fragment_name).with_content(/^secrets file\s*=.*$/) }
it { is_expected.not_to contain_concat__fragment(fragment_name).with_content(/^auth users\s*=.*$/) }
it { is_expected.not_to contain_concat__fragment(fragment_name).with_content(/^hosts allow\s*=.*$/) }
Expand Down Expand Up @@ -99,4 +100,11 @@
it { is_expected.to contain_concat__fragment(fragment_name).with_content(/^auth users\s*=\s*me, you, them$/)}
end

describe "when overriding dont_compress" do
let :params do
mandatory_params.merge({ :dont_compress => ['*.gz', '*.xz', '*.zip'] })
end
it { is_expected.to contain_concat__fragment(fragment_name).with_content(/^dont compress\s*=\s*\*.gz\s*\*.xz\s*\*.zip$/)}
end

end
3 changes: 3 additions & 0 deletions templates/module.erb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ hosts deny = <%= Array(@hosts_deny).join(' ')%>
<% if @exclude -%>
exclude = <%= Array(@exclude).join(' ')%>
<% end -%>
<% if @dont_compress -%>
dont compress = <%= Array(@dont_compress).join(' ')%>
<% end -%>
<% if @transfer_logging -%>
transfer logging = <%= @transfer_logging %>
<% end -%>
Expand Down