Skip to content

Commit

Permalink
Merge pull request #25 from blkperl/fix_puppet32x_dep
Browse files Browse the repository at this point in the history
Fix puppet 3.2.x deprecation warnings
  • Loading branch information
hunner committed Aug 26, 2013
2 parents b67b4dd + 45e5d75 commit 7122983
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 19 deletions.
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 -%>


0 comments on commit 7122983

Please sign in to comment.