aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Filion <gabster@lelutin.ca>2015-10-09 16:59:33 -0400
committerGabriel Filion <gabster@lelutin.ca>2015-10-09 17:22:31 -0400
commite714859a10776123afe77bbd15d9f7a02ea9682f (patch)
tree00565ae91e84e3b1b0ae49bebc4c1cac6dad2a8c
parent3dea5b8df77f1ab8224037eacb186ff0c026e378 (diff)
downloadpuppet-apt-e714859a10776123afe77bbd15d9f7a02ea9682f.tar.gz
puppet-apt-e714859a10776123afe77bbd15d9f7a02ea9682f.tar.bz2
Make it possible to specify own template.
Micah found an issue with usage of config_content: if you call template('...') yourself and pass that on to config_content, then your template gets evaluated without all of the variables. This means that you don't hava access to blacklisted_packages, mail_recipient or mailonlyonerror. To make it possible to use a different template while still having access to those variables, let's make it possible to change the template name that we're using.
-rw-r--r--manifests/unattended_upgrades.pp3
1 files changed, 2 insertions, 1 deletions
diff --git a/manifests/unattended_upgrades.pp b/manifests/unattended_upgrades.pp
index 6cb0518..ffb5fad 100644
--- a/manifests/unattended_upgrades.pp
+++ b/manifests/unattended_upgrades.pp
@@ -1,5 +1,6 @@
class apt::unattended_upgrades (
$config_content = undef,
+ $config_template = 'apt/50unattended-upgrades.erb',
$mailonlyonerror = true,
$mail_recipient = 'root',
$blacklisted_packages = [],
@@ -11,7 +12,7 @@ class apt::unattended_upgrades (
}
$file_content = $config_content ? {
- undef => template('apt/50unattended-upgrades.erb'),
+ undef => template($config_template),
default => $config_content
}