diff --git a/README.markdown b/README.markdown index c35dba7..afa44ff 100644 --- a/README.markdown +++ b/README.markdown @@ -94,8 +94,8 @@ sets up a rsync server $list - yes||no, defaults to no $uid - uid of rsync server, defaults to 0 $gid - gid of rsync server, defaults to 0 - $incoming_chmod - incoming file mode, defaults to 644 - $outgoing_chmod - outgoing file mode, defaults to 644 + $incoming_chmod - incoming file mode, defaults to no chmod + $outgoing_chmod - outgoing file mode, defaults to no chmod $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 @@ -121,15 +121,6 @@ sets up a rsync server require => File[$base], } -To disable default values for ``incoming_chmod`` and ``outgoing_chmod``, and -do not add empty values to the resulting config, set both values to ``false`` - - rsync::server::module { 'repo': - path => $base, - incoming_chmod => false, - outgoing_chmod => false, - require => File[$base], - } # Configuring via Hiera # ``rsync::put``, ``rsync::get``, and ``rsync::server::module`` resources can be @@ -138,8 +129,8 @@ configured using Hiera hashes. For example: rsync::server::modules: myrepo: path: /mypath - incoming_chmod: false - outgoing_chmod: false + incoming_chmod: 755 + outgoing_chmod: 755 myotherrepo: path: /otherpath read_only: false diff --git a/manifests/server/module.pp b/manifests/server/module.pp index f4fe6c6..388c7ad 100644 --- a/manifests/server/module.pp +++ b/manifests/server/module.pp @@ -10,8 +10,8 @@ # $list - yes||no, defaults to yes # $uid - uid of rsync server, defaults to 0 # $gid - gid of rsync server, defaults to 0 -# $incoming_chmod - incoming file mode, defaults to 0644 -# $outgoing_chmod - outgoing file mode, defaults to 0644 +# $incoming_chmod - incoming file mode, defaults to no chmod +# $outgoing_chmod - outgoing file mode, defaults to no chmod # $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 @@ -19,10 +19,10 @@ # $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. # $log_file - log messages to the indicated file rather than using syslog @@ -48,8 +48,8 @@ $list = 'yes', $uid = '0', $gid = '0', - $incoming_chmod = '0644', - $outgoing_chmod = '0644', + $incoming_chmod = undef, + $outgoing_chmod = undef, $max_connections = '0', $lock_file = '/var/run/rsyncd.lock', $secrets_file = undef, diff --git a/spec/defines/server_module_spec.rb b/spec/defines/server_module_spec.rb index 85df719..7883b91 100644 --- a/spec/defines/server_module_spec.rb +++ b/spec/defines/server_module_spec.rb @@ -35,8 +35,8 @@ it { is_expected.to contain_concat__fragment(fragment_name).with_content(/^list\s*=\s*yes$/) } it { is_expected.to contain_concat__fragment(fragment_name).with_content(/^uid\s*=\s*0$/) } it { is_expected.to contain_concat__fragment(fragment_name).with_content(/^gid\s*=\s*0$/) } - it { is_expected.to contain_concat__fragment(fragment_name).with_content(/^incoming chmod\s*=\s*0644$/) } - it { is_expected.to contain_concat__fragment(fragment_name).with_content(/^outgoing chmod\s*=\s*0644$/) } + it { is_expected.not_to contain_concat__fragment(fragment_name).with_content(/^incoming chmod.*$/) } + it { is_expected.not_to contain_concat__fragment(fragment_name).with_content(/^outgoing chmod.*$/) } 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(/^secrets file\s*=.*$/) } @@ -59,13 +59,14 @@ describe "when setting incoming chmod to false" do let :params do mandatory_params.merge({:incoming_chmod => false, - :outgoing_chmod => false, + :outgoing_chmod => false, }) end it { is_expected.not_to contain_file(fragment_name).with_content(/^incoming chmod.*$/) } it { is_expected.not_to contain_file(fragment_name).with_content(/^outgoing chmod.*$/) } end + { :comment => 'super module !', :read_only => 'no',