From 437babbd0768a3177363b9fea8b5a049227d6953 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Tue, 7 Nov 2017 19:38:01 -0500 Subject: [PATCH] get path from play if task does not have fixes #28451 --- lib/ansible/playbook/task.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/playbook/task.py b/lib/ansible/playbook/task.py index e19d8b60e3..de7523d130 100644 --- a/lib/ansible/playbook/task.py +++ b/lib/ansible/playbook/task.py @@ -106,6 +106,8 @@ class Task(Base, Conditional, Taggable, Become): path = "" if hasattr(self, '_ds') and hasattr(self._ds, '_data_source') and hasattr(self._ds, '_line_number'): path = "%s:%s" % (self._ds._data_source, self._ds._line_number) + elif hasattr(self._parent._play, '_ds') and hasattr(self._parent._play._ds, '_data_source') and hasattr(self._parent._play._ds, '_line_number'): + path = "%s:%s" % (self._parent._play._ds._data_source, self._parent._play._ds._line_number) return path def get_name(self):