Advertisement
Guest User

Get Absolut path ansible

a guest
Jan 19th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. ## Obtain full path for a file for action module
  2. def _get_absolute_path(self, path):
  3.     if path.startswith('/'):
  4.         return path
  5.     if self._task._role is not None:
  6.         path = self._loader.path_dwim_relative(self._task._role._role_path, 'files', path)
  7.     else:
  8.         path = self._loader.path_dwim_relative(self._loader.get_basedir(), 'files', path)
  9.     return path
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement