From 2dcec036ca9d7e99dd9f50c4031dafeb86d6b6c2 Mon Sep 17 00:00:00 2001 From: Nan Liu Date: Thu, 7 Jun 2012 14:53:41 -0700 Subject: [PATCH] Add logoutput on_failure for all exec resources. We need more information to debug issues on exec failure. This change enables logouput => on_failure. --- manifests/builddep.pp | 5 +++-- manifests/force.pp | 3 ++- manifests/key.pp | 20 +++++++++++--------- manifests/ppa.pp | 11 ++++++----- manifests/source.pp | 3 ++- manifests/update.pp | 1 + 6 files changed, 25 insertions(+), 18 deletions(-) diff --git a/manifests/builddep.pp b/manifests/builddep.pp index 997a206..3294f71 100644 --- a/manifests/builddep.pp +++ b/manifests/builddep.pp @@ -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. diff --git a/manifests/force.pp b/manifests/force.pp index 0089bbd..d3d5962 100644 --- a/manifests/force.pp +++ b/manifests/force.pp @@ -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', } } diff --git a/manifests/key.pp b/manifests/key.pp index 037eec5..dbbed2b 100644 --- a/manifests/key.pp +++ b/manifests/key.pp @@ -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', } } diff --git a/manifests/ppa.pp b/manifests/ppa.pp index 6b38e52..9527e0d 100644 --- a/manifests/ppa.pp +++ b/manifests/ppa.pp @@ -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}": diff --git a/manifests/source.pp b/manifests/source.pp index ce801bc..106b160 100644 --- a/manifests/source.pp +++ b/manifests/source.pp @@ -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"], } } diff --git a/manifests/update.pp b/manifests/update.pp index 016df7d..e9b9ea9 100644 --- a/manifests/update.pp +++ b/manifests/update.pp @@ -3,6 +3,7 @@ class apt::update { exec { 'apt_update': command => "${apt::params::provider} update", + logoutput => 'on_failure', refreshonly => true, } } -- 2.45.2