-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(SIMP-10740) Re-plumb rsync server data flow
rsync::server and rsync::server::global were in kind of a nasty circular dependency relationship wherein neither could by invoked decisively by the other using resource-style includes, because a circular inclusion relationship arose that would at a minimum break unit tests. Shifting tcpwrappers from global back into server untied most of this gordian knot, allowing data (e.g., address and port config) to be owned by one and passed to the other rather than circulated between them. This allows configuration to be passed authoritatively from the last point of user contact for server configuration out through the remainder of the module without the need for awkward data pathing to circumvent what should have been easy to do as a clean pass. No parameters were removed from any directly user-callable class. SIMP-10740 #comment Port and Address are now passed cleanly
- Loading branch information
1 parent
eed3f3d
commit 32e2140
Showing
4 changed files
with
54 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,9 @@ | |
# | ||
# See ``rsyncd.conf(5)`` for details of parameters not listed below. | ||
# | ||
# @param port | ||
# The port upon which to listen for client connections | ||
# | ||
# @param motd_file | ||
# The path to the default MOTD file that should be displayed upon connection | ||
# | ||
|
@@ -11,47 +14,22 @@ | |
# @param syslog_facility | ||
# A valid syslog ``facility`` to use for logging | ||
# | ||
# @param port | ||
# The port upon which to listen for client connections | ||
# | ||
# @param address | ||
# The IP address upon which to listen for connections | ||
# | ||
# * Leave this at ``127.0.0.1`` if using stunnel | ||
# | ||
# @param trusted_nets | ||
# The networks to allow to connect to this service | ||
# | ||
# | ||
# @param tcpwrappers | ||
# Use tcpwrappers to secure the rsync service | ||
# | ||
# @author Trevor Vaughan <[email protected]> | ||
# | ||
class rsync::server::global ( | ||
Simplib::Port $port, | ||
Optional[Stdlib::Absolutepath] $motd_file = undef, | ||
Stdlib::Absolutepath $pid_file = '/var/run/rsyncd.pid', | ||
String $syslog_facility = 'daemon', | ||
Simplib::Port $port = 873, | ||
Simplib::IP $address = '127.0.0.1', | ||
Simplib::Netlist $trusted_nets = simplib::lookup('simp_options::trusted_nets', { default_value => ['127.0.0.1'] }), | ||
Boolean $tcpwrappers = simplib::lookup('simp_options::tcpwrappers', { default_value => false }) | ||
) { | ||
assert_private() | ||
|
||
include '::rsync::server' | ||
|
||
if $tcpwrappers { | ||
include '::tcpwrappers' | ||
|
||
$_tcp_wrappers_name = $::rsync::server::stunnel ? { | ||
true => 'rsync_server', | ||
default => 'rsync', | ||
} | ||
|
||
tcpwrappers::allow { $_tcp_wrappers_name: pattern => $trusted_nets } | ||
} | ||
|
||
if $facts['selinux_current_mode'] and $facts['selinux_current_mode'] != 'disabled' { | ||
vox_selinux::port { "allow_rsync_port_${port}": | ||
ensure => 'present', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters