diff --git a/datadog_callback.py b/datadog_callback.py index 9d27ce7..c9694c0 100644 --- a/datadog_callback.py +++ b/datadog_callback.py @@ -124,7 +124,7 @@ def runner_on_failed(self, host, res, ignore_errors=False): def runner_on_ok(self, host, res): # Only send an event when the task has changed on the host - if res['changed']: + if res.get('changed'): event_text = "$$$\n{0}[{1}]\n$$$\n".format(res['invocation']['module_name'], res['invocation']['module_args']) self.send_task_event( 'Ansible task changed on "{0}"'.format(host),