ansible/ansible — pull request #1795 by dagwieers (2012-12-23 08:44:36+00:00)
Title: Add return code and error output to raw module

Since we use 'raw' heavily on equipment where 'command' and 'shell' are not working (and python may need to be installed first using raw) these improvements are necessary in order to write more complex scripts (with return code handling and separated stdout/stderr).

This patch includes the following changes:

- exec_command() now returns the return code of the command
- _low_level_exec_command() now returns a dict, including 'rc', 'stdout' and 'stderr')
- all users of the above interfaces have been improved to make use of the above changes
- all connection plugins (except fireball) have been modified to return rc and stderr

In a future commit I intend to add assertions or error handling code to verify the return code in those places where it wasn't done for _low_level_exec_command().