Skip to content

Exec[] should log the output of the command on failure

i added this to the platform, hoping we get more details in the logs, but this doesn't seem to work (see #6850 for an example):

--- git/leap_platform ‹develop› » git show 7bb8b2e
commit 7bb8b2e0685b3738c7842e86c09b826c2732e8bd
Author: varac 
Date:   Wed Apr 8 20:36:27 2015

    set the 'logoutput' parameter for any exec type to 'on_error'
    
    Change-Id: I04c796a502db52f3a594ef4c3cf08c330839bc13

diff --git a/puppet/modules/site_config/manifests/default.pp b/puppet/modules/site_config/manifests/default.pp
index aa49f93..c15080f 100644
--- a/puppet/modules/site_config/manifests/default.pp
+++ b/puppet/modules/site_config/manifests/default.pp
@@ -1,6 +1,10 @@
 class site_config::default {
   tag 'leap_base'
 
+  # the logoutput exec parameter defaults to "on_error" in puppet 3,
+  # but to "false" in puppet 2.7, so we need to set this globally here
+  Exec<||> { logoutput => on_failure }
+
   $services    = hiera('services', [])
   $domain_hash = hiera('domain')
   include site_config::params

i think the problem is that we include site_config::default in site.pp, where we also include the service-specific classes. BUT latter ones do not contain site_config::default, we should change this.

(from redmine: created on 2015-04-12, closed on 2015-04-26, relates #6850, relates #6900)