Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
ensure => directory,
}

# Template uses:
# - $use_chroot
# - $address
# - $motd_file
file { "${rsync_fragments}/header":
content => template('rsync/header.erb'),
}
Expand Down
8 changes: 5 additions & 3 deletions templates/header.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 -%>
44 changes: 28 additions & 16 deletions templates/module.erb
Original file line number Diff line number Diff line change
@@ -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 -%>