Skip to content

expanduser

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

  • Translates C(~) in a path to the proper user's home directory.

Parameters

Parameter Defaults / Choices Comments
_input
path
required
A string that contains a path.

Examples

# To get '/home/myuser/stuff.txt' from '~/stuff.txt'.
{{ mypath | expanduser }}

Return Values

Key Data Type Description Returned
_value path The translated path.

Authors

  • Ansible Core Team