relpath¶
Collection Note
This module is part of the ansible.builtin collection. To install the collection, use:
Added in version1.7.
Synopsis¶
- Converts the given path to a relative path from the O(start), or relative to the directory given in O(start).
Parameters¶
| Parameter | Defaults / Choices | Comments |
|---|---|---|
| _input str required |
A path. | |
| start str |
The directory the path should be relative to. If not supplied the current working directory will be used. |
Examples¶
# foobar => ../test/me.txt
testing: "{{ '/tmp/test/me.txt' | relpath('/tmp/other/') }}"
otherrelpath: "{{ mypath | relpath(mydir) }}"
Return Values¶
| Key | Data Type | Description | Returned |
|---|---|---|---|
| _value | str | The relative path. |
Authors¶
- Jakub Jirutka (@jirutka)