diff options
author | Tinyblargon <76069640+Tinyblargon@users.noreply.github.com> | 2024-10-08 17:35:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-08 17:35:35 +0200 |
commit | f3b956a7efc8c9596a15c16eb7fa038dd8ba9dbb (patch) | |
tree | edc67c9e788854c91f5e413972881a17002a1055 | |
parent | PlayIterator: skip tasks from already ran roles (#83793) (diff) | |
download | ansible-f3b956a7efc8c9596a15c16eb7fa038dd8ba9dbb.tar.xz ansible-f3b956a7efc8c9596a15c16eb7fa038dd8ba9dbb.zip |
docs: `unique` add missing settings (#84076)
add the `case_sensitive` setting
-rw-r--r-- | lib/ansible/plugins/filter/unique.yml | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/ansible/plugins/filter/unique.yml b/lib/ansible/plugins/filter/unique.yml index c627816b2e..83a4f92bac 100644 --- a/lib/ansible/plugins/filter/unique.yml +++ b/lib/ansible/plugins/filter/unique.yml @@ -10,6 +10,10 @@ DOCUMENTATION: description: A list. type: list required: true + case_sensitive: + description: Whether to consider case when comparing elements. + default: false + type: bool seealso: - plugin_type: filter plugin: ansible.builtin.difference @@ -24,6 +28,14 @@ EXAMPLES: | # list1: [1, 2, 5, 1, 3, 4, 10] {{ list1 | unique }} # => [1, 2, 5, 3, 4, 10] + + # return case sensitive unique elements + {{ ['a', 'A', 'a'] | unique('case_sensitive=true') }} + # => ['a', 'A'] + + # return case insensitive unique elements + {{ ['b', 'B', 'b'] | unique() }} + # => ['b'] RETURN: _value: description: A list with unique elements, also known as a set. |