src= parameters for template and copy operations can be relative to the playbook (for /usr/bin/ansible-playbook) or current directory (for /usr/bin/ansible)

This commit is contained in:
Michael DeHaan 2012-03-06 21:13:50 -05:00
parent 7eedc3fb1a
commit 8e20ed3714
3 changed files with 13 additions and 6 deletions

View file

@ -81,6 +81,7 @@ class PlayBook(object):
# playbook file can be passed in as a path or
# as file contents (to support API usage)
self.basedir = os.path.dirname(playbook)
self.playbook = self._parse_playbook(playbook)
def _include_tasks(self, play, task, dirname, new_tasks):
@ -178,7 +179,8 @@ class PlayBook(object):
module_path=self.module_path,
timeout=self.timeout,
remote_user=remote_user,
setup_cache=SETUP_CACHE
setup_cache=SETUP_CACHE,
basedir=self.basedir
).run()
def _run_task(self, pattern=None, task=None, host_list=None,