Allow to define includes and excludes for one action at different locations
currently it is only possible to define the includes where i call the action.
backupninja::action::borg { $customer:
include => [
'/etc',
'/var/backups/mysql/sqldump',
],
directory => "/./${fqdn}",
host => 'backup01.example.com',
user => 'foo',
compression => 'lz4',
encryption => 'keyfile',
}
lets say we have something like this:
$customers.each|String $customer, Hash $customer_parameters| {
$path = "/home/$customer/app"
backupninja::action::borg { $customer:
include => [
"${path}/uploads",
"${path}/documents",
"${path}/data",
],
directory => "/./${fqdn}",
}
}
this leads to one archive/action/borgfile for each customer. sometimes it would be better to have one archive for all customers (if customers is a bad example simply exchange customer with app).
also if you want to add the paths for one customer in the customer.pp
(called once for each customer) file but only want to configure the action one time in lets say app.pp
(called only one time) it would be more handy to have something like
i haven't found a solution for doing this with collected resources and arrays.
# dummy code
...
include => [Backupninja::Action::title<| fqdn== $fqdn |>],
...
it looks like the solution is using concat https://forge.puppet.com/puppetlabs/concat
app.pp
backupninja::action::borg { $customer:
directory => "/./${fqdn}",
}
customer.pp
backupninja::action::include { "/my-new-path-to-add": type => "borg" }