From 4a870a0f05a57acae63f36ed62d20f53a5202ae9 Mon Sep 17 00:00:00 2001 From: Natrinicle Date: Wed, 28 Jun 2017 10:43:40 -0600 Subject: [PATCH 1/2] Fixes for server header Allow address to be undef so that rsyncd can listen on all interfaces useful for IPv4/IPv6 dual stack boxes where you want the daemon to listen on both simultaneously. By setting address to :: the server was only listening on IPv6 but setting it to 0.0.0.0 it was only listening on IPv4. Leaving it out of the config makes the daemon listen on all interfaces at startup. --- manifests/server.pp | 4 ++-- templates/header.erb | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/manifests/server.pp b/manifests/server.pp index 2a3d00e..5c3e018 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -8,8 +8,8 @@ # class rsync::server( $use_xinetd = true, - $address = '0.0.0.0', - $motd_file = 'UNSET', + $address = undef, + $motd_file = undef, $use_chroot = 'yes', $uid = 'nobody', $gid = 'nobody', diff --git a/templates/header.erb b/templates/header.erb index 9068847..11d344b 100644 --- a/templates/header.erb +++ b/templates/header.erb @@ -8,7 +8,9 @@ use chroot = <%= @use_chroot %> log format = %t %a %m %f %b syslog facility = local3 timeout = 300 +<% if @address -%> address = <%= @address %> -<% if @motd_file != 'UNSET' -%> +<% end -%> +<% if @motd_file -%> motd file = <%= @motd_file %> <% end -%> From 3287e23cae7437d36b62517460d9e5cbd07de715 Mon Sep 17 00:00:00 2001 From: Natrinicle Date: Wed, 28 Jun 2017 10:43:40 -0600 Subject: [PATCH 2/2] Fixes for server header Allow address to be undef so that rsyncd can listen on all interfaces useful for IPv4/IPv6 dual stack boxes where you want the daemon to listen on both simultaneously. By setting address to :: the server was only listening on IPv6 but setting it to 0.0.0.0 it was only listening on IPv4. Leaving it out of the config makes the daemon listen on all interfaces at startup. --- manifests/server.pp | 4 ++-- spec/classes/server_spec.rb | 2 +- templates/header.erb | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/manifests/server.pp b/manifests/server.pp index 2a3d00e..5c3e018 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -8,8 +8,8 @@ # class rsync::server( $use_xinetd = true, - $address = '0.0.0.0', - $motd_file = 'UNSET', + $address = undef, + $motd_file = undef, $use_chroot = 'yes', $uid = 'nobody', $gid = 'nobody', diff --git a/spec/classes/server_spec.rb b/spec/classes/server_spec.rb index 5280702..d673fc8 100644 --- a/spec/classes/server_spec.rb +++ b/spec/classes/server_spec.rb @@ -17,7 +17,7 @@ :order => '00_header', }) is_expected.to contain_concat__fragment('rsyncd_conf_header').with_content(/^use chroot\s*=\s*yes$/) - is_expected.to contain_concat__fragment('rsyncd_conf_header').with_content(/^address\s*=\s*0.0.0.0$/) + is_expected.not_to contain_concat__fragment('rsyncd_conf_header').with_content(/^address\s*=.*$/) } end diff --git a/templates/header.erb b/templates/header.erb index 9068847..11d344b 100644 --- a/templates/header.erb +++ b/templates/header.erb @@ -8,7 +8,9 @@ use chroot = <%= @use_chroot %> log format = %t %a %m %f %b syslog facility = local3 timeout = 300 +<% if @address -%> address = <%= @address %> -<% if @motd_file != 'UNSET' -%> +<% end -%> +<% if @motd_file -%> motd file = <%= @motd_file %> <% end -%>