aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Filion <gabster@lelutin.ca>2015-04-17 16:43:26 -0400
committerGabriel Filion <gabster@lelutin.ca>2015-04-17 16:43:26 -0400
commit6f6e725e60f05a232ba6053cfc49ce1b219be7c7 (patch)
tree503ad86d2d73fadcaffa3d2f354043b5edce492d
parent0389b1126164bf8e884f5951d734d725bc718a66 (diff)
downloadpuppet-apt-6f6e725e60f05a232ba6053cfc49ce1b219be7c7.tar.gz
puppet-apt-6f6e725e60f05a232ba6053cfc49ce1b219be7c7.tar.bz2
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.
-rw-r--r--README4
-rw-r--r--manifests/unattended_upgrades.pp1
-rw-r--r--templates/50unattended-upgrades.erb8
3 files changed, 13 insertions, 0 deletions
diff --git a/README b/README
index 87b303a..9cf17d1 100644
--- a/README
+++ b/README
@@ -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
diff --git a/manifests/unattended_upgrades.pp b/manifests/unattended_upgrades.pp
index 7e17333..9f74bbd 100644
--- a/manifests/unattended_upgrades.pp
+++ b/manifests/unattended_upgrades.pp
@@ -2,6 +2,7 @@ class apt::unattended_upgrades (
$config_content = undef,
$mailonlyonerror = true,
$mail_recipient = 'root',
+ $blacklisted_packages = [],
) {
package { 'unattended-upgrades':
diff --git a/templates/50unattended-upgrades.erb b/templates/50unattended-upgrades.erb
index 318b69d..4492c2d 100644
--- a/templates/50unattended-upgrades.erb
+++ b/templates/50unattended-upgrades.erb
@@ -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";