sap.sap_operations.all filter – Return true if all elements in the iterable are truthy.
Note
This filter plugin is part of the sap.sap_operations collection.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install sap.sap_operations
.
To use it in a playbook, specify: sap.sap_operations.all
.
New in sap.sap_operations 1.7.0-galaxy
Synopsis
Return true if all elements in the iterable are truthy.
If not iterable, return the truthyness of value provided.
Returns True if the iterable is empty (empty list, or empty string).
Behaves like the Python builtin all function (for Iterable)
If not Iterable provided, behaves like the Python builtin bool function (for value)
Keyword parameters
This describes keyword parameters of the filter. These are the values key1=value1
, key2=value2
and so on in the following
example: input | sap.sap_operations.all(key1=value1, key2=value2, ...)
Parameter |
Comments |
---|---|
Iterable to check, if not iterable, return the truthyness of value provided. |
Notes
Note
This module is community supported
Module interface (parameters, output) expected to be stable but not guaranteed
Module planned to be released on Ansible Automation Hub after collecting some feedback
There is no guarantee that this module will be officially supported by Red Hat
Examples
- name: Test 'all' filter, this assertion is True
ansible.builtin.assert:
that: "{{ [true, true] | sap.sap_operations.all }}"
- name: Test 'all' filter, this assertion is True
ansible.builtin.assert:
that: "{{ ['true', 'false'] | sap.sap_operations.all }}"
- name: Test 'all' filter, this assertion is True
ansible.builtin.assert:
that: "{{ [1, 1] | sap.sap_operations.all }}"
- name: Test 'all' filter, this assertion is True
ansible.builtin.assert:
that: "{{ not ([1, 0] | sap.sap_operations.all) }}"
- name: Test 'all' filter, this assertion is True
ansible.builtin.assert:
that: "{{ ['1', '0'] | sap.sap_operations.all }}"
- name: Test 'all' filter, this assertion is True
ansible.builtin.assert:
that: "{{ 1 | sap.sap_operations.all }}"
- name: Test 'all' filter, this assertion is True
ansible.builtin.assert:
that: "{{ not ( 0 | sap.sap_operations.all ) }}"
- name: Test 'all' filter, this assertion is True
ansible.builtin.assert:
that: "{{ '' | sap.sap_operations.all }}"
- name: Test 'all' filter, this assertion is True
ansible.builtin.assert:
that: "{{ ' ' | sap.sap_operations.all }}"
- name: Test 'all' filter, this assertion is True
ansible.builtin.assert:
that: "{{ {1: 2} | sap.sap_operations.all }}"
- name: Test 'all' filter, this assertion is True
ansible.builtin.assert:
that: "{{ not ( None | sap.sap_operations.all ) }}"
Return Value
Key |
Description |
---|---|
True if all elements in the iterable are truthy or value provided is truthy. Returned: success Sample: |