Ansible Module fileglob: Difference between revisions
Jump to navigation
Jump to search
(Created page with "=External= * https://docs.ansible.com/ansible/latest/collections/ansible/builtin/fileglob_lookup.html#ansible-collections-ansible-builtin-fileglob-lookup =Internal= * Ansibl...") |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
=Internal= | =Internal= | ||
* [[Ansible Concepts#fileglob|Ansible Concepts]] | * [[Ansible Concepts#fileglob|Ansible Concepts]] | ||
* [[Ansible Module find|find Module]] | |||
=Overview= | =Overview= | ||
<font color=darkgray>TODO: Was not able to make it work, getting: couldn't resolve module/action 'fileglob'</font> | |||
A module that lists files matching a pattern. Patterns are only supported on files, not directory/paths. Matching is against local system files on the Ansible controller. Returns a string list of paths joined by commas, or an empty list if no files match. For a "true list" pass <code>wantlist=True</code> to the lookup. | |||
To iterate a list of files on a remote node, use the [[Ansible Module find|find]] module. | |||
=Example= | |||
<syntaxhighlight lang='yaml'> | |||
- name: Find all module descriptors from a Java installation module file | |||
fileglob: | |||
_terms: /Library/Java/JavaVirtualMachines/amazon-corretto-11.jdk/Contents/Home/jmods/*jmod | |||
</syntaxhighlight> |
Latest revision as of 09:10, 4 July 2021
External
Internal
Overview
TODO: Was not able to make it work, getting: couldn't resolve module/action 'fileglob'
A module that lists files matching a pattern. Patterns are only supported on files, not directory/paths. Matching is against local system files on the Ansible controller. Returns a string list of paths joined by commas, or an empty list if no files match. For a "true list" pass wantlist=True
to the lookup.
To iterate a list of files on a remote node, use the find module.
Example
- name: Find all module descriptors from a Java installation module file
fileglob:
_terms: /Library/Java/JavaVirtualMachines/amazon-corretto-11.jdk/Contents/Home/jmods/*jmod