ansible.builtin.contains (v2.15.2) — test

does the list contain this element

| "added in version" 2.4 of ansible.builtin"

Authors: Ansible Core

Install Ansible via pip

Install with pip install ansible-core==2.15.2

Description

Checks the supplied element against the input list to see if it exists within it.

Inputs

    
_input:
    description: List of elements to compare.
    elements: raw
    required: true
    type: list

_contained:
    description: Element to test for.
    required: true
    type: raw

Outputs

_value:
  description: Returns C(True) if the specified element is contained in the supplied
    sequence, C(False) otherwise.
  type: boolean