diff --git a/lib/ansible/cli/playbook.py b/lib/ansible/cli/playbook.py index 3dc1870960..98fa7bd762 100644 --- a/lib/ansible/cli/playbook.py +++ b/lib/ansible/cli/playbook.py @@ -160,6 +160,12 @@ class PlaybookCLI(CLI): display.display('\nplaybook: %s' % p['playbook']) for idx, play in enumerate(p['plays']): + if play._included_path is not None: + loader.set_basedir(play._included_path) + else: + pb_dir = os.path.realpath(os.path.dirname(p['playbook'])) + loader.set_basedir(pb_dir) + msg = "\n play #%d (%s): %s" % (idx + 1, ','.join(play.hosts), play.name) mytags = set(play.tags) msg += '\tTAGS: [%s]' % (','.join(mytags))