1
0
mirror of https://github.com/krislamo/puppet-rsnapshot synced 2024-12-16 09:40:35 +00:00

only create in-/exclude file if in-/excludes are given and bump version

This commit is contained in:
Norbert Varzariu 2015-12-22 16:26:06 +01:00
parent 4ead2ebeff
commit 25a282cf4f
4 changed files with 21 additions and 15 deletions

3
TODO
View File

@ -1,3 +1,4 @@
validate for puppet 3 => impossible, misses the .each function validate for puppet 3 => impossible, misses the .each function
Fix Documentation
only create exclude and/or include files if actually exclude/include are given

View File

@ -108,9 +108,20 @@ class rsnapshot::config (
$use_lazy_deletes_num = bool2num($use_lazy_deletes) $use_lazy_deletes_num = bool2num($use_lazy_deletes)
} }
file { $exclude_file: if $include != '' {
ensure => 'file', file { $include_file:
ensure => 'file',
content => template('rsnapshot/include.erb'),
}
} }
if $exclude != '' {
file { $exclude_file:
ensure => 'file',
content => template('rsnapshot/exclude.erb'),
}
}
file { $config: file { $config:
content => template('rsnapshot/rsnapshot.erb'), content => template('rsnapshot/rsnapshot.erb'),
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "loomsen-rsnapshot", "name": "loomsen-rsnapshot",
"version": "0.2.2", "version": "0.3.0",
"author": "loomsen", "author": "loomsen",
"summary": "Configures rsnapshot.", "summary": "Configures rsnapshot.",
"license": "Apache-2.0", "license": "Apache-2.0",

View File

@ -82,25 +82,19 @@ ssh_args <%= @ssh_args %>
<% if @du_args != '' -%> <% if @du_args != '' -%>
du_args <%= @du_args %> du_args <%= @du_args %>
<% end -%> <% end -%>
<% if @one_fs != '' %> <% if @one_fs != '' -%>
one_fs <%= @one_fs_num %> one_fs <%= @one_fs_num %>
<% end -%> <% end -%>
<% if @include != '' %> <% if @include != '' -%>
<% @include.each do |pattern| -%>
include <%= pattern %>
<% end -%>
<%end-%>
<% if @exclude != '' %>
<% @exclude.each do |pattern| -%>
exclude <%= pattern %>
<% end -%>
<%end-%>
<% if @include_file != '' -%> <% if @include_file != '' -%>
include_file <%= @include_file %> include_file <%= @include_file %>
<% end -%> <% end -%>
<% end -%>
<% if @exclude != '' -%>
<% if @exclude_file != '' -%> <% if @exclude_file != '' -%>
exclude_file <%= @exclude_file %> exclude_file <%= @exclude_file %>
<% end -%> <% end -%>
<% end -%>
<% if @link_dest != '' -%> <% if @link_dest != '' -%>
link_dest <%= @link_dest_num %> link_dest <%= @link_dest_num %>
<% end -%> <% end -%>