ansible.builtin.contains (v2.16.5) — 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.16.5

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 V(True) if the specified element is contained in the supplied
    sequence, V(False) otherwise.
  type: boolean