universe.common.get (0.1.2) — filter

Return the value for *key* if *key* is found in the object, else *default*.

| "added in version" 0.1.0 of universe.common"

Authors: unknown

Install collection

Install with ansible-galaxy collection install universe.common:==0.1.2


Add to requirements.yml

  collections:
    - name: universe.common
      version: 0.1.2

Description

Try each *key* into the given object until one matches.

Multiple keys can be provided. Only the value of the first key matching is returned.

If no key matches, *default* is returned.

If no default is provided and no key matches, ``None`` is returned.

Inputs

    
key:
    description: The key to be tried from the provided container.
    required: true
    type: raw

_input:
    description: The object to look into.
    required: true
    type: dict

default:
    description: A default value to be returned when no key matches.
    type: raw

Outputs

_value:
  description: The value mapped by the matching key.
  type: raw