Add logoutput on_failure for all exec resources.

We need more information to debug issues on exec failure. This change
enables logouput => on_failure.
This commit is contained in:
Nan Liu 2012-06-07 14:53:41 -07:00
parent f6e7e02632
commit 2dcec036ca
6 changed files with 25 additions and 18 deletions

View 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.

View 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',
}
}

View 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',
}
}

View 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}":

View 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"],
}
}

View file

@ -3,6 +3,7 @@ class apt::update {
exec { 'apt_update':
command => "${apt::params::provider} update",
logoutput => 'on_failure',
refreshonly => true,
}
}