Skip to content

fileglob

Collection Note

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

ansible-galaxy collection install ansible.builtin

Synopsis

  • Return a list of files that matches the supplied path glob pattern.
  • Filters run on the controller, so the files are matched from the controller's file system.

Parameters

Parameter Defaults / Choices Comments
_input
string
required
Path glob pattern.

Examples

# found = ['/etc/hosts', '/etc/hasts']
found: "{{ '/etc/h?sts' | fileglob }}"

Return Values

Key Data Type Description Returned
_value list List of files matched.