strip ansible_env from job event callback data

this often contains sensitive details, and the data is already filtered
and stored on the job itself

see: #5601
This commit is contained in:
Ryan Petrello 2017-03-02 11:57:22 -05:00 committed by Matthew Jones
parent 123756468d
commit ed5a01c0cf

View File

@ -304,6 +304,12 @@ class BaseCallbackModule(CallbackBase):
def v2_runner_on_ok(self, result):
# FIXME: Display detailed results or not based on verbosity.
# strip environment vars from the job event; it already exists on the
# job and sensitive values are filtered there
if result._task.get_name() == 'setup':
result._result.get('ansible_facts', {}).pop('ansible_env', None)
event_data = dict(
host=result._host.get_name(),
remote_addr=result._host.address,