provide an easy way to acess stdout and stderr of ansible-playbook process
Right now, the ansible-playbook process executed by ansible_playbook fixture during setup or tear down of a test case sends the output to stdout and stderr without any processing, so that the output is available to pytest. This means that when ansible_playbook fixture fails and a test case ends in ERROR state, the stdout and stderr from the ansible is provided, which helps the debugging of what went wrong there. The other way to access output of ansible is to use py.test -s.
That said, there is no direct an easy way to check output of a particular setup or teardown ansible run. This issue proposes the following solution:
- add pytest option
--ansible-playbook-outdirwhich would specify a path to directory, where files with stderr/stdout of a particular ansible run would be created - when the option is used, the stdout and stderr is still send to the pytest, so that when an error happens, the full report is shown to the user (if we did just the redirection, the most critical part of the error message would be missing from the report)
The question is how to organize files in the output directory.