sap / sap.sap_operations / 1.25.0 / filter / any Return true if any element in the iterable is truthy. | "added in version" 1.7.0-galaxy of sap.sap_operations" Authors: Kirill Satarin (@kksat)sap.sap_operations.any (1.25.0) — filter
Install with ansible-galaxy collection install sap.sap_operations:==1.25.0
collections: - name: sap.sap_operations version: 1.25.0
Return true if any element in the iterable is truthy.
If not iterable, return the truthyness of value provided.
Returns False if the iterable is empty (empty list, or empty string).
Behaves like the Python builtin any function (for Iterable)
If not Iterable provided, behaves like the Python builtin bool function (for value)
- name: Test 'any' filter, this assertion is True ansible.builtin.assert: that: "{{ [true, true] | sap.sap_operations.any }}"
- name: Test 'any' filter, this assertion is True ansible.builtin.assert: that: "{{ ['true', 'false'] | sap.sap_operations.any }}"
- name: Test 'any' filter, this assertion is True ansible.builtin.assert: that: "{{ [1, 1] | sap.sap_operations.any }}"
- name: Test 'any' filter, this assertion is True ansible.builtin.assert: that: "{{ not ([1, 0] | sap.sap_operations.any) }}"
- name: Test 'any' filter, this assertion is True ansible.builtin.assert: that: "{{ ['1', '0'] | sap.sap_operations.any }}"
- name: Test 'any' filter, this assertion is True ansible.builtin.assert: that: "{{ 1 | sap.sap_operations.any }}"
- name: Test 'any' filter, this assertion is True ansible.builtin.assert: that: "{{ not ( 0 | sap.sap_operations.any ) }}"
- name: Test 'any' filter, this assertion is True ansible.builtin.assert: that: "{{ '' | sap.sap_operations.any }}"
- name: Test 'any' filter, this assertion is True ansible.builtin.assert: that: "{{ ' ' | sap.sap_operations.any }}"
- name: Test 'any' filter, this assertion is True ansible.builtin.assert: that: "{{ {1: 2} | sap.sap_operations.any }}"
- name: Test 'any' filter, this assertion is True ansible.builtin.assert: that: "{{ not ( None | sap.sap_operations.any ) }}"
value: description: Iterable to check, if not iterable, return the truthyness of value provided. required: true
data: description: True if any element in the iterable is truthy or value provided is truthy. example: true type: boolean