From dc3acf627d99c394dbe1bb6c1eafee9efc28738a Mon Sep 17 00:00:00 2001 From: David Moreau-Simard Date: Sun, 20 Aug 2017 00:01:38 -0400 Subject: [PATCH] Default tasks without file references to the main playbook file Some implicit tasks (is the setup task from "gather_facts: yes" the only one?) do not currently have a file reference as documented in an issue upstream [1]. Work around the issue in the meantime and default to the main playbook file if there is no references so that we don't have to handle this edge case. [1]: https://github.com/ansible/ansible/issues/28451 Change-Id: I72526ee47bbe86022c60bc5fd23ca9627f86a4de (cherry picked from commit 24439f60e56afdcc73a4af69ca270e105678941d) --- ara/plugins/callbacks/log_ara.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ara/plugins/callbacks/log_ara.py b/ara/plugins/callbacks/log_ara.py index 7bd633d0..b7419935 100644 --- a/ara/plugins/callbacks/log_ara.py +++ b/ara/plugins/callbacks/log_ara.py @@ -282,9 +282,9 @@ class CallbackModule(CallbackBase): lineno = int(lineno) file_ = self.get_or_create_file(path) else: - path = None - lineno = None - file_ = None + path = self.playbook.path + lineno = 1 + file_ = self.get_or_create_file(self.playbook.path) self.task = models.Task( name=task.get_name(),