Skip to content

abs

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 path is absolute, not relative.
  • An absolute path expresses the location of a filesystem object starting at the filesystem root and requires no context.
  • A relative path does not start at the filesystem root and requires a 'current' directory as a context to resolve.

Parameters

Parameter Defaults / Choices Comments
_input
path
A path.

Examples

is_path_absolute: "{{ '/etc/hosts' is abs }}}"
relative_paths: "{{ all_paths | reject('abs') }}"

Return Values

Key Data Type Description Returned
_value boolean Returns V(True) if the path is absolute, V(False) if it is relative.

Authors

  • Ansible Core