]> gitweb.fluxo.info Git - puppet-apt.git/commitdiff
Add parameter for blacklisting a list of packages.
authorGabriel Filion <gabster@lelutin.ca>
Fri, 17 Apr 2015 20:43:26 +0000 (16:43 -0400)
committerGabriel Filion <gabster@lelutin.ca>
Fri, 17 Apr 2015 20:43:26 +0000 (16:43 -0400)
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.

README
manifests/unattended_upgrades.pp
templates/50unattended-upgrades.erb

diff --git a/README b/README
index 87b303a1ebf622e89f585c145bef258e2ec57b64..9cf17d134bb4e250589a15434308d94a45ddc972 100644 (file)
--- 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 
index 7e173334345a9ed01d4d8414765b694f820bc2ae..9f74bbd7edcc6abf37442af63ce6de9bbb973d1a 100644 (file)
@@ -2,6 +2,7 @@ class apt::unattended_upgrades (
   $config_content = undef,
   $mailonlyonerror = true,
   $mail_recipient = 'root',
+  $blacklisted_packages = [],
 ) {
 
   package { 'unattended-upgrades':
index 318b69d217381856a42b45ba0899565c60073c36..4492c2d18070974cbe03a5f5d753ca59a88688d7 100644 (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";