Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default chmod behaviour, update xinetd dependency. #80

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
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
17 changes: 4 additions & 13 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
14 changes: 7 additions & 7 deletions manifests/server/module.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
# $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
# $secrets_file - path to the file that contains the username:password pairs used for authenticating this module
# $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
Expand All @@ -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,
Expand Down
7 changes: 4 additions & 3 deletions spec/defines/server_module_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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*=.*$/) }
Expand All @@ -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',
Expand Down