From ba468dcc31e921e22af2b4ccc6a51a5c89bd9eab Mon Sep 17 00:00:00 2001 From: William Van Hevelingen Date: Fri, 23 Aug 2013 13:11:30 -0700 Subject: [PATCH 1/3] Fix puppet 3.2.x deprecation warnings --- templates/header.erb | 8 +++++--- templates/module.erb | 32 ++++++++++++++++---------------- 2 files changed, 21 insertions(+), 19 deletions(-) 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..ed15422 100644 --- a/templates/module.erb +++ b/templates/module.erb @@ -1,21 +1,21 @@ # 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 != :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 %> From 9e7f6c0ddd8090ebfa9f66814a5cf21f6a38c815 Mon Sep 17 00:00:00 2001 From: William Van Hevelingen Date: Fri, 23 Aug 2013 13:13:41 -0700 Subject: [PATCH 2/3] Add template uses comment --- manifests/server.pp | 4 ++++ 1 file changed, 4 insertions(+) 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'), } From 45e5d75fe223244471772f9757e92d9f9b2537ae Mon Sep 17 00:00:00 2001 From: William Van Hevelingen Date: Fri, 23 Aug 2013 13:41:34 -0700 Subject: [PATCH 3/3] Simplify module template logic --- templates/module.erb | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/templates/module.erb b/templates/module.erb index ed15422..cf7ccbe 100644 --- a/templates/module.erb +++ b/templates/module.erb @@ -11,11 +11,23 @@ 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 %> +<% 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 -%>