From: Silvio Rhatto Date: Tue, 22 Jan 2013 14:22:40 +0000 (-0200) Subject: Fixing handling for include and exclude parameters as arrays at rsync template X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=018f03e5fdcfe433acb34a143599fca3dfbffc33;p=puppet-backupninja.git Fixing handling for include and exclude parameters as arrays at rsync template --- diff --git a/templates/rsync.conf.erb b/templates/rsync.conf.erb index 71bf0b6..163ffc3 100644 --- a/templates/rsync.conf.erb +++ b/templates/rsync.conf.erb @@ -12,9 +12,13 @@ end -%> [source] -<%- %w{from include exclude}.each do |v| - if has_variable?(v) and instance_variable_get("@#{v}").to_s != "false" -%> -<%= v + ' = ' + instance_variable_get("@#{v}").to_s %> +<% unless from.empty? and from.to_s != "false" -%> +from = <%= from %> +<% end -%> +<%- %w{include exclude}.each do |v| + if has_variable?(v) + instance_variable_get("@#{v}").to_a.each do |parameter| -%> +<%= v + ' = ' + parameter %> <%- end end -%>