Skip to content

Commit

Permalink
Merge pull request #73 from nanliu/tb/logoutput
Browse files Browse the repository at this point in the history
Add logoutput on_failure for all exec resources.
  • Loading branch information
Branan Purvine-Riley committed Jun 7, 2012
2 parents f6e7e02 + 2dcec03 commit 9d20803
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 18 deletions.
5 changes: 3 additions & 2 deletions manifests/builddep.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
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.
Expand Down
3 changes: 2 additions & 1 deletion manifests/force.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
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',
}
}
20 changes: 11 additions & 9 deletions manifests/key.pp
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@
'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"],
}
}

Expand All @@ -63,11 +64,12 @@
}

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

Expand Down
11 changes: 6 additions & 5 deletions manifests/ppa.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@
}

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}":
Expand Down
3 changes: 2 additions & 1 deletion manifests/source.pp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@
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"],
}
}

Expand Down
1 change: 1 addition & 0 deletions manifests/update.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

exec { 'apt_update':
command => "${apt::params::provider} update",
logoutput => 'on_failure',
refreshonly => true,
}
}

0 comments on commit 9d20803

Please sign in to comment.