]> gitweb.fluxo.info Git - puppet-apt.git/commitdiff
introduce a class to manage unattended-upgrades
authormh <mh@immerda.ch>
Fri, 30 Oct 2009 19:35:30 +0000 (20:35 +0100)
committermh <mh@immerda.ch>
Fri, 30 Oct 2009 19:35:30 +0000 (20:35 +0100)
README
manifests/init.pp
manifests/unattended_upgrades.pp [new file with mode: 0644]

diff --git a/README b/README
index c6e6c4e9e563959e028bda256d5180459f7c3585..e624bba6583789a7556ab020dd500ad79b689274 100644 (file)
--- a/README
+++ b/README
@@ -34,7 +34,6 @@ From apt.conf(5), 0.7.2:
      instance). pre-auto performs this action before downloading new
      packages."
 
-
 $lsbdistcodename
 ----------------       
 Contains the codename ("etch", "lenny", ...) of the client's
@@ -69,6 +68,13 @@ apt keyring, you can set this variable to a path in your fileserver
 where individual key files can be placed. If this is set and keys
 exist there, this module will apt-key add each key
 
+$apt_unattended_upgrades
+------------------------
+
+If this variable is set to true apt::unattended_upgrades is included,
+which will install the package unattended-upgrades and configure it to
+daily upgrade the system.
+
 Classes
 =======
 
index d6a8fb7b76d8bb0a91a3dad07b80c64be5ea3306..5dc0d759c83330201072bb1ece70686582a06f41 100644 (file)
@@ -41,6 +41,10 @@ class apt {
     }
   }
 
+  if $apt_unattended_upgrades {
+    include apt::unattended_upgrades
+  }
+
   $apt_base_dir = "${module_dir_path}/apt"
   module_dir { apt: }
   # watch apt.conf.d
diff --git a/manifests/unattended_upgrades.pp b/manifests/unattended_upgrades.pp
new file mode 100644 (file)
index 0000000..f4544fa
--- /dev/null
@@ -0,0 +1,12 @@
+class apt::unattended_upgrades {
+  package{'unattended-upgrades': }
+  config_file {
+      "/etc/apt/apt.conf.d/unattended_upgrades":
+        content => "APT::Periodic::Update-Package-Lists "1";
+APT::Periodic::Unattended-Upgrade "1";
+",
+        before => File[apt_config],
+        require => Package['unattended-upgrades'],
+    }
+  }
+}