mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-28 11:10:21 -07:00
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:
parent
7eedc3fb1a
commit
8e20ed3714
3 changed files with 13 additions and 6 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue