summaryrefslogtreecommitdiffstats
path: root/lib/ansible/plugins/filter/split.yml
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 16:04:21 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 16:04:21 +0000
commit8a754e0858d922e955e71b253c139e071ecec432 (patch)
tree527d16e74bfd1840c85efd675fdecad056c54107 /lib/ansible/plugins/filter/split.yml
parentInitial commit. (diff)
downloadansible-core-8a754e0858d922e955e71b253c139e071ecec432.tar.xz
ansible-core-8a754e0858d922e955e71b253c139e071ecec432.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/split.yml')
-rw-r--r--lib/ansible/plugins/filter/split.yml32
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/ansible/plugins/filter/split.yml b/lib/ansible/plugins/filter/split.yml
new file mode 100644
index 0000000..3e7b59e
--- /dev/null
+++ b/lib/ansible/plugins/filter/split.yml
@@ -0,0 +1,32 @@
+DOCUMENTATION:
+ name: split
+ version_added: "historical"
+ short_description: split a string into a list
+ description:
+ - Using Python's text object method C(split) we turn strings into lists via a 'spliting character'.
+ notes:
+ - This is a passthrough to Python's C(str.split).
+ positional: _input, _split_string
+ options:
+ _input:
+ description: A string to split.
+ type: str
+ required: true
+ _split_string:
+ description: A string on which to split the original.
+ type: str
+ default: ' '
+
+EXAMPLES: |
+
+ # listjojo => [ "jojo", "is", "a" ]
+ listjojo: "{{ 'jojo is a' | split }}"
+
+ # listjojocomma => [ "jojo is", "a" ]
+ listjojocomma: "{{ 'jojo is, a' | split(',' }}"
+
+RETURN:
+ _value:
+ description: List of substrings split from the original.
+ type: list
+ elements: str