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 8
8
#
9
9
class rsync::server (
10
10
$use_xinetd = true ,
11
- $address = ' 0.0.0.0 ' ,
11
+ $address = ' UNSET ' ,
12
12
$motd_file = ' UNSET' ,
13
13
Variant[Enum[' UNSET' ], Stdlib::Absolutepath] $pid_file = ' /var/run/rsyncd.pid' ,
14
14
$use_chroot = ' yes' ,
43
43
if $use_xinetd {
44
44
include xinetd
45
45
xinetd::service { 'rsync' :
46
- bind => $address ,
47
46
port => ' 873' ,
48
47
server => ' /usr/bin/rsync' ,
49
48
server_args => " --daemon --config ${conf_file} " ,
50
49
require => Package[' rsync' ],
51
50
}
51
+
52
+ if ($address != ' UNSET' ) {
53
+ Xinetd::Service[' rsync' ] {
54
+ bind => $address ,
55
+ }
56
+ }
52
57
} else {
53
58
if ($facts [' os' ][' family' ] == ' RedHat' ) and
54
59
(Integer($facts [' os' ][' release' ][' major' ]) >= 8) and
Original file line number Diff line number Diff line change 9
9
describe 'when using default params' do
10
10
it {
11
11
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 )
13
13
is_expected . not_to contain_service ( 'rsync' )
14
14
is_expected . not_to contain_file ( '/etc/rsync-motd' )
15
15
is_expected . to contain_concat__fragment ( 'rsyncd_conf_header' ) . with ( order : '00_header' )
16
16
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$} )
18
17
is_expected . to contain_concat__fragment ( 'rsyncd_conf_header' ) . with_content ( %r{^pid file\s *=\s */var/run/rsyncd.pid$} )
19
18
}
20
19
end
76
75
end
77
76
78
77
it {
78
+ is_expected . to contain_xinetd__service ( 'rsync' ) . with ( bind : '10.0.0.42' )
79
79
is_expected . to contain_concat__fragment ( 'rsyncd_conf_header' ) . with_content ( %r{^address\s *=\s *10.0.0.42$} )
80
80
}
81
81
end
Original file line number Diff line number Diff line change @@ -10,7 +10,9 @@ use chroot = <%= @use_chroot %>
10
10
log format = %t %a %m %f %b
11
11
syslog facility = local3
12
12
timeout = 300
13
+ <% if @address != 'UNSET' -%>
13
14
address = <%= @address %>
15
+ <% end -%>
14
16
<% if @motd_file != 'UNSET' -%>
15
17
motd file = <%= @motd_file %>
16
18
<% end -%>
You can’t perform that action at this time.
0 commit comments