diff --git a/README.markdown b/README.markdown index 93e5c7e..46fd4d3 100644 --- a/README.markdown +++ b/README.markdown @@ -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) diff --git a/manifests/server/module.pp b/manifests/server/module.pp index 9ac1705..eef2ba4 100644 --- a/manifests/server/module.pp +++ b/manifests/server/module.pp @@ -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. # @@ -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, diff --git a/spec/defines/server_module_spec.rb b/spec/defines/server_module_spec.rb index c3d24f8..84e861c 100644 --- a/spec/defines/server_module_spec.rb +++ b/spec/defines/server_module_spec.rb @@ -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*=.*$/) } @@ -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 diff --git a/templates/module.erb b/templates/module.erb index 8077fc7..b3a8701 100644 --- a/templates/module.erb +++ b/templates/module.erb @@ -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 -%>