Skip to content

expandvars

Collection Note

This module is part of the ansible.builtin collection. To install the collection, use:

ansible-galaxy collection install ansible.builtin
Added in version 1.5.

Synopsis

  • Will do a shell-like substitution of environment variables on the provided input.

Parameters

Parameter Defaults / Choices Comments
_input
str
required
A string that contains environment variables.

Examples

# To get '/home/myuser/stuff.txt' from '$HOME/stuff.txt'
{{ mypath | expandvars }}

Return Values

Key Data Type Description Returned
_value str The string with translated environment variable values.

Authors

  • Ansible Core Team