Add parameter for blacklisting a list of packages.

This functionality was lost because we stopped using a source file for
the 50unattended-upgrades file that would previously let one override
the configuration per release or per host.
This commit is contained in:
Gabriel Filion 2015-04-17 16:43:26 -04:00
parent 0389b11261
commit 6f6e725e60
3 changed files with 13 additions and 0 deletions

4
README
View file

@ -17,6 +17,10 @@ Ubuntu support is lagging behind but not absent either.
! Upgrade Notice !
* If you were using custom 50unattended-upgrades.${::lsbdistcodename} in your
site_apt, these are no longer supported. You should migrate to passing
$blacklisted_packages to the apt::unattended_upgrades class.
* the apt class has been moved to a paramterized class. if you were including
this class before, after passing some variables, you will need to move to
instantiating the class with those variables instead. For example, if you

View file

@ -2,6 +2,7 @@ class apt::unattended_upgrades (
$config_content = undef,
$mailonlyonerror = true,
$mail_recipient = 'root',
$blacklisted_packages = [],
) {
package { 'unattended-upgrades':

View file

@ -16,6 +16,14 @@ Unattended-Upgrade::Allowed-Origins {
<% end -%>
};
<% if not @blacklisted_packages.empty? -%>
Unattended-Upgrade::Package-Blacklist {
<% @blacklisted_packages.each do |pkg| -%>
"<%= pkg %>";
<% end -%>
}
<% end -%>
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::Unattended-Upgrade "1";