ansible.builtin.basename (v2.16.0) — filter

get a path's base name

| "added in version" historical of ansible.builtin"

Authors: ansible core team

Install Ansible via pip

Install with pip install ansible-core==2.16.0

Description

Returns the last name component of a path, what is left in the string that is not 'dirname'.

Inputs

    
_input:
    description: A path.
    required: true
    type: path

Outputs

_value:
  description: The base name from the path provided.
  type: str

See also