sap.sap_operations.all (1.25.0) — filter

Return true if all elements in the iterable are truthy.

| "added in version" 1.7.0-galaxy of sap.sap_operations"

Authors: Kirill Satarin (@kksat)

Install collection

Install with ansible-galaxy collection install sap.sap_operations:==1.25.0


Add to requirements.yml

  collections:
    - name: sap.sap_operations
      version: 1.25.0

Description

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)

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Test 'all' filter, this assertion is True
  ansible.builtin.assert:
    that: "{{ [true, true] | sap.sap_operations.all }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Test 'all' filter, this assertion is True
  ansible.builtin.assert:
    that: "{{ ['true', 'false'] | sap.sap_operations.all }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Test 'all' filter, this assertion is True
  ansible.builtin.assert:
    that: "{{ [1, 1] | sap.sap_operations.all }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Test 'all' filter, this assertion is True
  ansible.builtin.assert:
    that: "{{ not ([1, 0] | sap.sap_operations.all) }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Test 'all' filter, this assertion is True
  ansible.builtin.assert:
    that: "{{ ['1', '0'] | sap.sap_operations.all }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Test 'all' filter, this assertion is True
  ansible.builtin.assert:
    that: "{{ 1 | sap.sap_operations.all }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Test 'all' filter, this assertion is True
  ansible.builtin.assert:
    that: "{{ not ( 0 | sap.sap_operations.all ) }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Test 'all' filter, this assertion is True
  ansible.builtin.assert:
    that: "{{ '' | sap.sap_operations.all }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Test 'all' filter, this assertion is True
  ansible.builtin.assert:
    that: "{{ ' ' | sap.sap_operations.all }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Test 'all' filter, this assertion is True
  ansible.builtin.assert:
    that: "{{ {1: 2} | sap.sap_operations.all }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Test 'all' filter, this assertion is True
  ansible.builtin.assert:
    that: "{{ not ( None | sap.sap_operations.all ) }}"

Inputs

    
value:
    description: Iterable to check, if not iterable, return the truthyness of value provided.
    required: true

Outputs

data:
  description: True if all elements in the iterable are truthy or value provided is
    truthy.
  example: true
  type: boolean