Skip to content

is_same_file

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 2.5.

Synopsis

  • Check if the provided paths map to the same location on the controller's filesystem (localhost).

Parameters

Parameter Defaults / Choices Comments
_input
path
required
A path.
_path2
path
required
Another path.

Examples

amionelevelfromroot: "{{ '/etc/hosts' is same_file('../etc/hosts') }}"

Return Values

Key Data Type Description Returned
_value boolean Returns V(True) if the paths correspond to the same location on the filesystem on the controller, V(False) if otherwise.

Authors

  • Ansible Core