parent
8abd6370df
commit
fc7859f445
3 changed files with 3 additions and 3 deletions
|
@ -171,7 +171,7 @@ class PlayBook(object):
|
|||
self.inventory.set_playbook_basedir(self.basedir)
|
||||
|
||||
vars = extra_vars.copy()
|
||||
vars['playbook_dir'] = self.basedir
|
||||
vars['playbook_dir'] = os.path.abspath(self.basedir)
|
||||
if self.inventory.basedir() is not None:
|
||||
vars['inventory_dir'] = self.inventory.basedir()
|
||||
|
||||
|
|
|
@ -77,6 +77,7 @@ class Play(object):
|
|||
self.tags = []
|
||||
|
||||
# make sure we have some special internal variables set
|
||||
self.vars['playbook_dir'] = os.path.abspath(self.basedir)
|
||||
if self.playbook.inventory.basedir() is not None:
|
||||
self.vars['inventory_dir'] = self.playbook.inventory.basedir()
|
||||
if self.playbook.inventory.src() is not None:
|
||||
|
@ -153,7 +154,6 @@ class Play(object):
|
|||
|
||||
load_vars = {}
|
||||
load_vars['role_names'] = ds.get('role_names',[])
|
||||
load_vars['playbook_dir'] = self.basedir
|
||||
|
||||
self._tasks = self._load_tasks(self._ds.get('tasks', []), load_vars)
|
||||
self._handlers = self._load_tasks(self._ds.get('handlers', []), load_vars)
|
||||
|
|
|
@ -612,7 +612,7 @@ class Runner(object):
|
|||
inject['vars'] = self.module_vars
|
||||
inject['defaults'] = self.default_vars
|
||||
inject['environment'] = self.environment
|
||||
inject['playbook_dir'] = self.basedir
|
||||
inject['playbook_dir'] = os.path.abspath(self.basedir)
|
||||
|
||||
# template this one is available, callbacks use this
|
||||
delegate_to = self.module_vars.get('delegate_to')
|
||||
|
|
Loading…
Reference in a new issue