From 8a754e0858d922e955e71b253c139e071ecec432 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 18:04:21 +0200 Subject: Adding upstream version 2.14.3. Signed-off-by: Daniel Baumann --- lib/ansible/plugins/filter/path_join.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 lib/ansible/plugins/filter/path_join.yml (limited to 'lib/ansible/plugins/filter/path_join.yml') diff --git a/lib/ansible/plugins/filter/path_join.yml b/lib/ansible/plugins/filter/path_join.yml new file mode 100644 index 0000000..d50deaa --- /dev/null +++ b/lib/ansible/plugins/filter/path_join.yml @@ -0,0 +1,30 @@ +DOCUMENTATION: + name: path_join + author: Anthony Bourguignon (@Toniob) + version_added: "2.10" + short_description: Join one or more path components + positional: _input + description: + - Returns a path obtained by joining one or more path components. + options: + _input: + description: A path, or a list of paths. + type: list + elements: str + required: true + +EXAMPLES: | + + # If path == 'foo/bar' and file == 'baz.txt', the result is '/etc/foo/bar/subdir/baz.txt' + {{ ('/etc', path, 'subdir', file) | path_join }} + + # equivalent to '/etc/subdir/{{filename}}' + wheremyfile: "{{ ['/etc', 'subdir', filename] | path_join }}" + + # trustme => '/etc/apt/trusted.d/mykey.gpgp' + trustme: "{{ ['/etc', 'apt', 'trusted.d', 'mykey.gpg'] | path_join }}" + +RETURN: + _value: + description: The concatenated path. + type: str -- cgit v1.2.3