@ -6,6 +6,8 @@ DOCUMENTATION:
positional : _input
positional : _input
description:
description:
- Returns a path obtained by joining one or more path components.
- Returns a path obtained by joining one or more path components.
- If a path component is an absolute path, then all previous components
are ignored and joining continues from the absolute path. See examples for details.
options:
options:
_input:
_input:
description : A path, or a list of paths.
description : A path, or a list of paths.
@ -21,9 +23,14 @@ EXAMPLES: |
# equivalent to '/etc/subdir/{{filename}}'
# equivalent to '/etc/subdir/{{filename}}'
wheremyfile : "{{ ['/etc', 'subdir', filename] | path_join }}"
wheremyfile : "{{ ['/etc', 'subdir', filename] | path_join }}"
# trustme => '/etc/apt/trusted.d/mykey.gpg p '
# trustme => '/etc/apt/trusted.d/mykey.gpg '
trustme : "{{ ['/etc', 'apt', 'trusted.d', 'mykey.gpg'] | path_join }}"
trustme : "{{ ['/etc', 'apt', 'trusted.d', 'mykey.gpg'] | path_join }}"
# If one of the paths is absolute, then path_join ignores all previous path components
# If backup_dir == '/tmp' and backup_file == '/sample/baz.txt', the result is '/sample/baz.txt'
# backup_path => "/sample/baz.txt"
backup_path : "{{ ('/etc', backup_dir, backup_file) | path_join }}"
RETURN:
RETURN:
_value:
_value:
description : The concatenated path.
description : The concatenated path.