diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 16:04:21 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 16:04:21 +0000 |
commit | 8a754e0858d922e955e71b253c139e071ecec432 (patch) | |
tree | 527d16e74bfd1840c85efd675fdecad056c54107 /lib/ansible/plugins/filter/relpath.yml | |
parent | Initial commit. (diff) | |
download | ansible-core-upstream.tar.xz ansible-core-upstream.zip |
Adding upstream version 2.14.3.upstream/2.14.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/ansible/plugins/filter/relpath.yml')
-rw-r--r-- | lib/ansible/plugins/filter/relpath.yml | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/ansible/plugins/filter/relpath.yml b/lib/ansible/plugins/filter/relpath.yml new file mode 100644 index 0000000..47611c7 --- /dev/null +++ b/lib/ansible/plugins/filter/relpath.yml @@ -0,0 +1,28 @@ +DOCUMENTATION: + name: relpath + author: Jakub Jirutka (@jirutka) + version_added: "1.7" + short_description: Make a path relative + positional: _input, start + description: + - Converts the given path to a relative path from the I(start), + or relative to the directory given in I(start). + options: + _input: + description: A path. + type: str + required: true + start: + description: The directory the path should be relative to. If not supplied the current working directory will be used. + type: str + +EXAMPLES: | + + # foobar => ../test/me.txt + testing: "{{ '/tmp/test/me.txt' | relpath('/tmp/other/') }}" + otherrelpath: "{{ mypath | relpath(mydir) }}" + +RETURN: + _value: + description: The relative path. + type: str |