mirror of https://github.com/ansible/ansible.git
Adding two new os.path filters and its docs (#78794)
* Adding two new os.path filters and its docs Signed-off-by: Shivam Durgbuns <sdurgbun@redhat.com>pull/78798/head
parent
4115ddd135
commit
8444d47b11
@ -0,0 +1,24 @@
|
|||||||
|
DOCUMENTATION:
|
||||||
|
name: commonpath
|
||||||
|
author: Shivam Durgbuns
|
||||||
|
version_added: "2.15"
|
||||||
|
short_description: gets the common path
|
||||||
|
description:
|
||||||
|
- Returns the longest common path from the given list of paths.
|
||||||
|
options:
|
||||||
|
_input:
|
||||||
|
description: A list of paths
|
||||||
|
type: list of path
|
||||||
|
required: true
|
||||||
|
seealso:
|
||||||
|
- plugin: ansible.builtin.basename
|
||||||
|
plugin_type: filter
|
||||||
|
EXAMPLES: |
|
||||||
|
|
||||||
|
# To get the longest common path(ex. '/foo/bar') from the given list of paths(ex. ['/foo/bar/foobar','/foo/bar'])
|
||||||
|
{{ listofpaths | commonpath }}
|
||||||
|
|
||||||
|
RETURN:
|
||||||
|
_value:
|
||||||
|
description: The longest common path from the given list of paths.
|
||||||
|
type: path
|
Loading…
Reference in New Issue