Detect failed sysvinit module (#43127)

* Detect failed sysvinit module

- This checks the stderr instead of the rc to detect whether the
  sysvinit module was successful or not, as even when failing, the
  rc would be 0.
- It immediatly became obvious that the debug info when failing
  was far too little to properly debug the role. To improve this,
  I also added the rc, stderr and stdout to the debug output.

* Revert stderr check to rc check, rename out->stdout, err->stderr
This commit is contained in:
uwila 2018-07-24 01:58:42 +02:00 committed by Brian Coca
parent d5d29f4cfa
commit c0048007a9

View file

@ -311,7 +311,7 @@ def main():
# FIXME: ERRORS
if rc != 0:
module.fail_json(msg="Failed to %s service: %s" % (action, name))
module.fail_json(msg="Failed to %s service: %s" % (action, name), rc=rc, stdout=out, stderr=err)
return (rc, out, err)