Skip to main content
abspath(path) converts path to an absolute path. Relative paths are resolved from the playbook’s working directory.

Signature

Example

Ensure that a volume mount path in a Docker run command is always absolute, regardless of where errand is invoked from:
./data becomes something like /home/user/project/data, which is required by docker run.

Notes

  • abspath resolves the path relative to the effective working directory at evaluation time.
  • If path is already absolute, it is returned cleaned but otherwise unchanged.