]> review.fuel-infra Code Review - puppet-modules/puppetlabs-apt.git/commitdiff
Add logoutput on_failure for all exec resources.
authorNan Liu <nan@puppetlabs.com>
Thu, 7 Jun 2012 21:53:41 +0000 (14:53 -0700)
committerNan Liu <nan@puppetlabs.com>
Thu, 7 Jun 2012 21:53:41 +0000 (14:53 -0700)
We need more information to debug issues on exec failure. This change
enables logouput => on_failure.

manifests/builddep.pp
manifests/force.pp
manifests/key.pp
manifests/ppa.pp
manifests/source.pp
manifests/update.pp

index 997a2064f85e8c372c387c0c50255c4caffd27ba..3294f713391c79d6f07e400c690f15d00c4dc611 100644 (file)
@@ -4,8 +4,9 @@ define apt::builddep() {
   include apt::update
 
   exec { "apt-builddep-${name}":
-    command => "/usr/bin/apt-get -y --force-yes build-dep ${name}",
-    notify  => Exec['apt_update'],
+    command   => "/usr/bin/apt-get -y --force-yes build-dep ${name}",
+    logoutput => 'on_failure',
+    notify    => Exec['apt_update'],
   }
 
   # Need anchor to provide containment for dependencies.
index 0089bbd75393d02044e62427a7470a0528405b31..d3d5962d0889a5975c81d62b8acd468015319ea2 100644 (file)
@@ -16,6 +16,7 @@ define apt::force(
     default => "/usr/bin/dpkg -s ${name} | grep -q 'Version: ${version}'",
   }
   exec { "/usr/bin/aptitude -y -t ${release} install ${name}${version_string}":
-    unless => $install_check,
+    unless    => $install_check,
+    logoutput => 'on_failure',
   }
 }
index 037eec5288f789937ca492382064715df982034e..dbbed2bef0df5e58aea588e1b292d5a1a628359c 100644 (file)
@@ -46,10 +46,11 @@ define apt::key (
           'server'  => "apt-key adv --keyserver '${key_server}' --recv-keys '${upkey}'",
         }
         exec { $digest:
-          path    => '/bin:/usr/bin',
-          unless  => "/usr/bin/apt-key list | /bin/grep '${upkey}'",
-          before  => Anchor["apt::key ${upkey} present"],
-          command => $digest_command,
+          command   => $digest_command,
+          path      => '/bin:/usr/bin',
+          unless    => "/usr/bin/apt-key list | /bin/grep '${upkey}'",
+          logoutput => 'on_failure',
+          before    => Anchor["apt::key ${upkey} present"],
         }
       }
 
@@ -63,11 +64,12 @@ define apt::key (
       }
 
       exec { "apt::key ${upkey} absent":
-        path    => '/bin:/usr/bin',
-        onlyif  => "apt-key list | grep '${upkey}'",
-        command => "apt-key del '${upkey}'",
-        user    => 'root',
-        group   => 'root',
+        command   => "apt-key del '${upkey}'",
+        path      => '/bin:/usr/bin',
+        onlyif    => "apt-key list | grep '${upkey}'",
+        user      => 'root',
+        group     => 'root',
+        logoutput => 'on_failure',
       }
     }
 
index 6b38e52d63164b8249adea6e2b5142829c54050d..9527e0d624d3113fa0f72a20d55e5364c3e6a4c2 100644 (file)
@@ -22,11 +22,12 @@ define apt::ppa(
   }
 
   exec { "add-apt-repository-${name}":
-    command => "/usr/bin/add-apt-repository ${name}",
-    creates => "${sources_list_d}/${sources_list_d_filename}",
-    require => [ File[$sources_list_d],
-                 Package['python-software-properties'] ],
-    notify  => Exec['apt_update'],
+    command   => "/usr/bin/add-apt-repository ${name}",
+    creates   => "${sources_list_d}/${sources_list_d_filename}",
+    logoutput => 'on_failure',
+    require   => [ File[$sources_list_d],
+                   Package['python-software-properties'] ],
+    notify    => Exec['apt_update'],
   }
 
   file { "${sources_list_d}/${sources_list_d_filename}":
index ce801bc76c90c793230ae874c89bb7b86c2ca5d6..106b16000c47be91fe8ac4ec7e791209b230fb18 100644 (file)
@@ -52,8 +52,9 @@ define apt::source(
   if ($required_packages != false) and ($ensure == 'present') {
     exec { "Required packages: '${required_packages}' for ${name}":
       command     => "${provider} -y install ${required_packages}",
-      subscribe   => File["${name}.list"],
+      logoutput   => 'on_failure',
       refreshonly => true,
+      subscribe   => File["${name}.list"],
     }
   }
 
index 016df7d6af8032dfd32fc7ac85eb40efec9ccbdb..e9b9ea9554b941bf0e1757ac034d9b3114108c89 100644 (file)
@@ -3,6 +3,7 @@ class apt::update {
 
   exec { 'apt_update':
     command     => "${apt::params::provider} update",
+    logoutput   => 'on_failure',
     refreshonly => true,
   }
 }