File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 88#
99class rsync::server (
1010 Boolean $use_xinetd = true ,
11- $address = ' 0.0.0.0 ' ,
11+ $address = ' UNSET ' ,
1212 $motd_file = ' UNSET' ,
1313 Variant[Enum[' UNSET' ], Stdlib::Absolutepath] $pid_file = ' /var/run/rsyncd.pid' ,
1414 $use_chroot = ' yes' ,
2626 if $use_xinetd {
2727 include xinetd
2828 xinetd::service { 'rsync' :
29- bind => $address ,
3029 port => ' 873' ,
3130 server => ' /usr/bin/rsync' ,
3231 server_args => " --daemon --config ${conf_file} " ,
3332 require => Package[' rsync' ],
3433 }
34+
35+ if ($address != ' UNSET' ) {
36+ Xinetd::Service[' rsync' ] {
37+ bind => $address ,
38+ }
39+ }
3540 } else {
3641
3742 # Manage the installation of the rsyncd package?
Original file line number Diff line number Diff line change 99 describe 'when using default params' do
1010 it {
1111 is_expected . to contain_class ( 'xinetd' )
12- is_expected . to contain_xinetd__service ( 'rsync' ) . with ( bind : '0.0.0.0' )
12+ is_expected . to contain_xinetd__service ( 'rsync' ) . with ( port : 873 )
1313 is_expected . not_to contain_service ( 'rsync' )
1414 is_expected . not_to contain_file ( '/etc/rsync-motd' )
1515 is_expected . to contain_concat__fragment ( 'rsyncd_conf_header' ) . with ( order : '00_header' )
1616 is_expected . to contain_concat__fragment ( 'rsyncd_conf_header' ) . with_content ( %r{^use chroot\s *=\s *yes$} )
17- is_expected . to contain_concat__fragment ( 'rsyncd_conf_header' ) . with_content ( %r{^address\s *=\s *0.0.0.0$} )
1817 is_expected . to contain_concat__fragment ( 'rsyncd_conf_header' ) . with_content ( %r{^pid file\s *=\s */var/run/rsyncd.pid$} )
1918 }
2019 end
7675 end
7776
7877 it {
78+ is_expected . to contain_xinetd__service ( 'rsync' ) . with ( bind : '10.0.0.42' )
7979 is_expected . to contain_concat__fragment ( 'rsyncd_conf_header' ) . with_content ( %r{^address\s *=\s *10.0.0.42$} )
8080 }
8181 end
Original file line number Diff line number Diff line change @@ -10,7 +10,9 @@ use chroot = <%= @use_chroot %>
1010log format = %t %a %m %f %b
1111syslog facility = local3
1212timeout = 300
13+ <% if @address != 'UNSET' -%>
1314address = <%= @address %>
15+ <% end -%>
1416<% if @motd_file != 'UNSET' -%>
1517motd file = <%= @motd_file %>
1618<% end -%>
You can’t perform that action at this time.
0 commit comments