Issue #13858 has been updated by Gustavo Fernandes.

We had the same issues in our servers, puppet kick was exiting with status 0 
when one or more nodes were getting error. We solved with a simple patch in the 
/usr/lib64/ruby/site_ruby/1.8/puppet/application/kick.rb file:

    --- kick.rb      2012-03-06 23:29:44.000000000 +0000
    +++ kick.rb      2012-03-06 23:29:44.000000000 +0000
    @@ -258,8 +258,21 @@
    :ignoreschedules => options[:ignoreschedules]
    }
    run = Puppet::Run.indirection.save(Puppet::Run.new( run_options ), url)
    +      report = run.options[:report]
    +      report_error = false
    +      report.logs.each do |log|
    +          if log.level == :err
    +             puts log.message
    +             report_error = true
    +          end
    +      end
    +
    puts "Getting status"
    -      result = run.status
    +      if(report_error == false)
    +          result = run.status
    +      else
    +          result = "Manifest error"
    +      end
    puts "status is #{result}"
    rescue => detail
    puts detail.backtrace if Puppet[:trace]

That causes the kick to report errors like this:

    # puppet kick --host myhost123 --foreground --debug
    Host myhost123 returned unknown answer 'Manifest error'
    change from running to stopped failed: Could not stop Service[myservice]: 
Execution of '/sbin/service myservice stop' returned 1:  at 
/etc/puppet/modules/mymodule/manifests/init.pp:97
    Getting status
    status is Manifest error
    myhost123 finished with exit code 12

Very useful when you are kicking 10+ servers since it points to the root of the 
problem and avoid having to keep tailing each node's log. it requires, 
obviously, --foreground to wait until all the runs happens in all nodes

----------------------------------------
Bug #13858: Custom types in environments require loading into master's libdir
https://projects.puppetlabs.com/issues/13858#change-68565

Author: eric sorenson
Status: Merged - Pending Release
Priority: Normal
Assignee: Patrick Carlisle
Category: modules
Target version: 3.0.0
Affected Puppet version: 
Keywords: 
Branch: 
https://github.com/pcarlisle/puppet/tree/ticket/master/13858-types-in-environments


An attempt to distill down the back-and-forth from #4409, as it applies to 
2.7.x:

* The master needs to load new types locally to validate parameters
* In order to do so, the type rb files need to be available in the master's 
`$libdir`, and only get there by being pluginsync'ed
* Therefore, environments which have custom types in `$modulepath` directories 
that the master does not itself use (when running as a client), cannot be used.




-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to