env – read the value of environment variables — Ansible Documentation

- AnsibleFest
- Products
- Community
- Webinars & Training
- Blog

Documentation

# env – read the value of environment variables

- Synopsis

- Parameters

- Examples

- Return Values

- Status

## Synopsis

- Allows you to query the environment variables available on the controller when you invoked Ansible.

## Parameters

Parameter | Choices/Defaults | Configuration | Comments
--- | --- | --- | ---
_terms - / required |  |  | Environment variable or list of them to lookup the values for

## Examples

    - debug: msg="{{ lookup('env','HOME') }} is an environment variable"

## Return Values

Common return values are documented here, the following are the fields unique to this lookup:

Key | Returned | Description
--- | --- | ---
_list list |  | values from the environment variables.

## Status

- This lookup is not guaranteed to have a backwards compatible interface. [preview]

- This lookup is maintained by the Ansible Community. [community]

### Authors

- Jan-Piet Mens (@jpmens) <jpmens(at)gmail.com>

Hint

If you notice any issues in this documentation, you can edit this document to improve it.

Hint

Configuration entries for each entry type have a low to high priority order. For example, a variable that is lower in the list will override a variable that is higher up.