Correctly set loader path when using list tags/tasks
Fixes #19398
(cherry picked from commit b688f11474
)
This commit is contained in:
parent
20df246504
commit
f7ff28336d
1 changed files with 6 additions and 0 deletions
|
@ -158,6 +158,12 @@ class PlaybookCLI(CLI):
|
||||||
|
|
||||||
display.display('\nplaybook: %s' % p['playbook'])
|
display.display('\nplaybook: %s' % p['playbook'])
|
||||||
for idx, play in enumerate(p['plays']):
|
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)
|
msg = "\n play #%d (%s): %s" % (idx + 1, ','.join(play.hosts), play.name)
|
||||||
mytags = set(play.tags)
|
mytags = set(play.tags)
|
||||||
msg += '\tTAGS: [%s]' % (','.join(mytags))
|
msg += '\tTAGS: [%s]' % (','.join(mytags))
|
||||||
|
|
Loading…
Reference in a new issue