diff --git a/manifests/server.pp b/manifests/server.pp index 9ce1cfe..ebdbc0e 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -42,6 +42,10 @@ ensure => directory, } + # Template uses: + # - $use_chroot + # - $address + # - $motd_file file { "${rsync_fragments}/header": content => template('rsync/header.erb'), } diff --git a/templates/header.erb b/templates/header.erb index 51e7526..01cb023 100644 --- a/templates/header.erb +++ b/templates/header.erb @@ -4,9 +4,11 @@ pid file = /var/run/rsyncd.pid uid = nobody gid = nobody -use chroot = <%= use_chroot %> +use chroot = <%= @use_chroot %> log format = %t %a %m %f %b syslog facility = local3 timeout = 300 -address = <%= address %> -<% if motd_file != 'UNSET' %>motd file = <%= motd_file %><% end %> +address = <%= @address %> +<% if @motd_file != 'UNSET' -%> +motd file = <%= @motd_file %> +<% end -%> diff --git a/templates/module.erb b/templates/module.erb index 0ccc34c..cf7ccbe 100644 --- a/templates/module.erb +++ b/templates/module.erb @@ -1,21 +1,33 @@ # This file is being maintained by Puppet. # DO NOT EDIT -[ <%= name %> ] -path = <%= path %> -read only = <%= read_only %> -write only = <%= write_only %> -list = <%= list %> -uid = <%= uid %> -gid = <%= gid %> -incoming chmod = <%= incoming_chmod %> -outgoing chmod = <%= outgoing_chmod %> -max connections = <%= max_connections %> -<% if Integer(max_connections) > 0 %>lock file = <%= lock_file %><% end %> -<% if comment != :undef %>comment = <%= comment %><% end %> -<% if secrets_file != :undef %>secrets file = <%= secrets_file %><% end %> -<% if auth_users != :undef %>auth users = <%= auth_users.to_a.join(', ')%><% end %> -<% if hosts_allow != :undef %>hosts allow = <%= hosts_allow.to_a.join(' ')%><% end %> -<% if hosts_deny != :undef %>hosts deny = <%= hosts_deny.to_a.join(' ')%><% end %> +[ <%= @name %> ] +path = <%= @path %> +read only = <%= @read_only %> +write only = <%= @write_only %> +list = <%= @list %> +uid = <%= @uid %> +gid = <%= @gid %> +incoming chmod = <%= @incoming_chmod %> +outgoing chmod = <%= @outgoing_chmod %> +max connections = <%= @max_connections %> +<% if Integer(@max_connections) > 0 -%> +lock file = <%= @lock_file %> +<% end -%> +<% if @comment -%> +comment = <%= @comment %> +<% end -%> +<% if @secrets_file -%> +secrets file = <%= @secrets_file %> +<% end -%> +<% if @auth_users -%> +auth users = <%= @auth_users.to_a.join(', ')%> +<% end %> +<% if @hosts_allow -%> +hosts allow = <%= @hosts_allow.to_a.join(' ')%> +<% end -%> +<% if @hosts_deny -%> +hosts deny = <%= @hosts_deny.to_a.join(' ')%> +<% end -%>