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 $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' ,
4343 if $use_xinetd {
4444 include xinetd
4545 xinetd::service { 'rsync' :
46- bind => $address ,
4746 port => ' 873' ,
4847 server => ' /usr/bin/rsync' ,
4948 server_args => " --daemon --config ${conf_file} " ,
5049 require => Package[' rsync' ],
5150 }
51+
52+ if ($address != ' UNSET' ) {
53+ Xinetd::service[' rsync' ] {
54+ bind => $address ,
55+ }
56+ }
5257 } else {
5358 if ($facts [' os' ][' family' ] == ' RedHat' ) and
5459 (Integer($facts [' os' ][' release' ][' major' ]) >= 8) and
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