make it possible to opt out of MailOnlyOnError
This combines all files into one template. It should make maintenance easier.
This commit is contained in:
parent
bb12a296a0
commit
9192785c45
4 changed files with 22 additions and 34 deletions
|
@ -1,12 +0,0 @@
|
||||||
// this file is managed by puppet !
|
|
||||||
|
|
||||||
Unattended-Upgrade::Origins-Pattern {
|
|
||||||
"o=Debian,a=oldstable,l=Debian-Security";
|
|
||||||
"o=Debian,a=stable,l=Debian-Security";
|
|
||||||
}
|
|
||||||
|
|
||||||
APT::Periodic::Update-Package-Lists "1";
|
|
||||||
APT::Periodic::Download-Upgradeable-Packages "1";
|
|
||||||
APT::Periodic::Unattended-Upgrade "1";
|
|
||||||
|
|
||||||
Unattended-Upgrade::Mail "root";
|
|
|
@ -1,14 +0,0 @@
|
||||||
// this file is managed by puppet !
|
|
||||||
|
|
||||||
Unattended-Upgrade::Allowed-Origins {
|
|
||||||
// "${distro-id} oldstable";
|
|
||||||
// "${distro_id} ${distro_codename}-backports";
|
|
||||||
"${distro_id} ${distro_codename}-security";
|
|
||||||
"${distro_id} ${distro_codename}-lts";
|
|
||||||
};
|
|
||||||
|
|
||||||
APT::Periodic::Update-Package-Lists "1";
|
|
||||||
APT::Periodic::Download-Upgradeable-Packages "1";
|
|
||||||
APT::Periodic::Unattended-Upgrade "1";
|
|
||||||
|
|
||||||
Unattended-Upgrade::Mail "root";
|
|
|
@ -1,15 +1,19 @@
|
||||||
class apt::unattended_upgrades {
|
class apt::unattended_upgrades (
|
||||||
|
$config_content = undef,
|
||||||
|
$mailonlyonerror = true,
|
||||||
|
) {
|
||||||
|
|
||||||
package { 'unattended-upgrades':
|
package { 'unattended-upgrades':
|
||||||
ensure => present
|
ensure => present
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$file_content = $config_content ? {
|
||||||
|
undef => template('apt/50unattended-upgrades.erb'),
|
||||||
|
default => $config_content
|
||||||
|
}
|
||||||
|
|
||||||
apt_conf { '50unattended-upgrades':
|
apt_conf { '50unattended-upgrades':
|
||||||
source => [
|
content => $file_content,
|
||||||
"puppet:///modules/site_apt/${::lsbdistid}/50unattended-upgrades.${::lsbdistcodename}",
|
|
||||||
"puppet:///modules/site_apt/${::lsbdistid}/50unattended-upgrades",
|
|
||||||
"puppet:///modules/apt/${::lsbdistid}/50unattended-upgrades.${::lsbdistcodename}",
|
|
||||||
"puppet:///modules/apt/${::lsbdistid}/50unattended-upgrades" ],
|
|
||||||
require => Package['unattended-upgrades'],
|
require => Package['unattended-upgrades'],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,26 @@
|
||||||
// this file is managed by puppet !
|
// this file is managed by puppet !
|
||||||
|
|
||||||
Unattended-Upgrade::Allowed-Origins {
|
Unattended-Upgrade::Allowed-Origins {
|
||||||
|
<% if scope.lookupvar('::operatingsystem') == 'Ubuntu' -%>
|
||||||
"${distro_id}:${distro_codename}-security";
|
"${distro_id}:${distro_codename}-security";
|
||||||
"${distro_id}:${distro_codename}-updates";
|
"${distro_id}:${distro_codename}-updates";
|
||||||
"${distro_id}:${distro_codename}-backports";
|
"${distro_id}:${distro_codename}-backports";
|
||||||
//"${distro_id}:${distro_codename}-proposed";
|
<% else -%>
|
||||||
|
<% if scope.lookupvar('::lsbdistcodename') == 'squeeze' -%>
|
||||||
|
"${distro-id} ${distro-codename}-security";
|
||||||
|
"${distro-id} ${distro-codename}-lts";
|
||||||
|
<% else -%>
|
||||||
|
# See Debian bug #704087
|
||||||
|
"o=Debian,a=oldstable,l=Debian-Security";
|
||||||
|
"o=Debian,a=stable,l=Debian-Security";
|
||||||
|
<% end -%>
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
APT::Periodic::Update-Package-Lists "1";
|
APT::Periodic::Update-Package-Lists "1";
|
||||||
APT::Periodic::Download-Upgradeable-Packages "1";
|
APT::Periodic::Download-Upgradeable-Packages "1";
|
||||||
APT::Periodic::Unattended-Upgrade "1";
|
APT::Periodic::Unattended-Upgrade "1";
|
||||||
|
|
||||||
Unattended-Upgrade::Mail "root";
|
Unattended-Upgrade::Mail "root";
|
||||||
|
<% if mailonlyonerror -%>
|
||||||
Unattended-Upgrade::MailOnlyOnError "true";
|
Unattended-Upgrade::MailOnlyOnError "true";
|
||||||
|
<% end -%>
|
Loading…
Reference in a new issue