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.
This commit is contained in:
parent
3dea5b8df7
commit
e714859a10
1 changed files with 2 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
||||||
class apt::unattended_upgrades (
|
class apt::unattended_upgrades (
|
||||||
$config_content = undef,
|
$config_content = undef,
|
||||||
|
$config_template = 'apt/50unattended-upgrades.erb',
|
||||||
$mailonlyonerror = true,
|
$mailonlyonerror = true,
|
||||||
$mail_recipient = 'root',
|
$mail_recipient = 'root',
|
||||||
$blacklisted_packages = [],
|
$blacklisted_packages = [],
|
||||||
|
@ -11,7 +12,7 @@ class apt::unattended_upgrades (
|
||||||
}
|
}
|
||||||
|
|
||||||
$file_content = $config_content ? {
|
$file_content = $config_content ? {
|
||||||
undef => template('apt/50unattended-upgrades.erb'),
|
undef => template($config_template),
|
||||||
default => $config_content
|
default => $config_content
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue