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
This commit is contained in:
parent
5c3c791b76
commit
24439f60e5
|
@ -271,9 +271,9 @@ class CallbackModule(CallbackBase):
|
||||||
lineno = int(lineno)
|
lineno = int(lineno)
|
||||||
file_ = self.get_or_create_file(path)
|
file_ = self.get_or_create_file(path)
|
||||||
else:
|
else:
|
||||||
path = None
|
path = self.playbook.path
|
||||||
lineno = None
|
lineno = 1
|
||||||
file_ = None
|
file_ = self.get_or_create_file(self.playbook.path)
|
||||||
|
|
||||||
self.task = models.Task(
|
self.task = models.Task(
|
||||||
name=task.get_name(),
|
name=task.get_name(),
|
||||||
|
|
Loading…
Reference in New Issue