diff options
author | Micah Anderson <micah@riseup.net> | 2008-12-08 15:35:30 -0500 |
---|---|---|
committer | Micah Anderson <micah@riseup.net> | 2008-12-08 15:35:30 -0500 |
commit | 72493d7caa635eb8ef210bc0a402b5579f85d98c (patch) | |
tree | 1b1f1e40cb44178219f762819327bad42f4ac981 /templates | |
parent | 756ed8c5c53132e972e005c7990ec78c4f40caea (diff) | |
download | puppet-backupninja-72493d7caa635eb8ef210bc0a402b5579f85d98c.tar.gz puppet-backupninja-72493d7caa635eb8ef210bc0a402b5579f85d98c.tar.bz2 |
setup rdiff handler template to work properly for different versions of puppet
Diffstat (limited to 'templates')
-rw-r--r-- | templates/rdiff.conf.erb | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/templates/rdiff.conf.erb b/templates/rdiff.conf.erb index 7fbfe73..0e19125 100644 --- a/templates/rdiff.conf.erb +++ b/templates/rdiff.conf.erb @@ -28,8 +28,25 @@ type = local <% end -%> [dest] -<% %w{type host directory user sshoptions}.each do |v| - if has_variable?(v) - -%><%= v + ' = ' + instance_variable_get("@#{v}") + "\n" %><% - end -end -%> +<%- include Puppet::Util::Package + class VersionComparer; extend Puppet::Util::Package; end + + if VersionComparer.versioncmp(Puppet.version,'0.24.6') >= 0 + %w{type host directory user sshoptions}.each do |v| + if has_variable?(v) + -%> +<%= v + ' = ' + instance_variable_get("@#{v}").to_s %> + <%- + end + end + %> +<%- else -%> + <%- %w{type host directory user sshoptions}.each do |v| + if @scope.lookupvar(v) + -%> +<%= v + ' = ' + @scope.lookupvar(v) %> + <%- + end + end + %> +<%- end -%> |