]> gitweb.fluxo.info Git - puppet-apt.git/commitdiff
added $apt_disable_update to disable "apt-get update" during puppetruns
authornadir <nadir-technik@nadir.org>
Thu, 8 Nov 2012 09:07:38 +0000 (10:07 +0100)
committernadir <nadir-technik@nadir.org>
Thu, 8 Nov 2012 09:07:38 +0000 (10:07 +0100)
manifests/dist_upgrade.pp
manifests/init.pp
manifests/upgrade_package.pp

index 9e26769bb6bbacb889135535a37c9c42fc844a6a..347ccc783097921446668a7f8ebff05fcd7fbe49 100644 (file)
@@ -1,6 +1,6 @@
 class apt::dist_upgrade {
 
-  include apt::update
+  if $apt::disable_update = false { include apt::update }
 
   exec { 'apt_dist-upgrade':
     command     => "/usr/bin/apt-get -q -y -o 'DPkg::Options::=--force-confold' dist-upgrade",
index 2ae691fa61c4aead194414975ab311a206580297..794347f6c7b2489a2014dffae65d8fe786de96ec 100644 (file)
@@ -40,6 +40,11 @@ class apt {
     ''      => 'http://archive.ubuntu.com/ubuntu',
     default => "${apt_ubuntu_url}",
   }
+  $disable_update = $apt_disable_update ? {
+    ''      => false,
+    default => $apt_disable_update  
+  }
+
   case $operatingsystem {
     'debian': {
       $repos = $apt_repos ? {
index 9202624bad747ffbb48ab67495805dfae9e3d110..2ce6932dbaa5b1e9ff50919066621d7121145035 100644 (file)
@@ -1,6 +1,8 @@
 define apt::upgrade_package ($version = "") {
 
-  include apt::update
+  if $apt::disable_update == false { 
+    include apt::update 
+  }
 
   $version_suffix = $version ? {
     ''       => '',
@@ -24,10 +26,11 @@ define apt::upgrade_package ($version = "") {
 
   exec { "apt-get -q -y -o 'DPkg::Options::=--force-confold' install ${name}${version_suffix}":
     onlyif => [ "grep-status -F Status installed -a -P $name -q", "apt-show-versions -u $name | grep -q upgradeable" ],
-    require => [
-      Exec['apt_updated'],
-      Package['apt-show-versions', 'dctrl-tools'],
-    ],
+    require => $apt::disable_update ? {
+      true    => Package['apt-show-versions', 'dctrl-tools'],
+      default => [ Exec['apt_updated'], 
+                 Package['apt-show-versions', 'dctrl-tools'] ],
+    } 
   }
 
 }