Files
Wiki/Ansible/modules_plugins.md
Michael Schlapa 1f270317bb fileglob + example
2020-03-24 11:15:34 +01:00

2.5 KiB

Modules

All modules

Module Description
file Manage files and file properties.
gather_facts Gathers facts about remote hosts.
lineinfile Manage lines in text files.
seport Manages SELinux network port type definitions.
systemd Manage services.
template Template a file out to a remote server.
unarchive Unpacks an archive after (optionally) copying it from the local machine.
wait_for Waits for a condition before continuing.
wait_for_connection Waits until remote system is reachable/usable.

Plugins

Plugin Description
fileglob List files matching a pattern.

Examples

fileglob

fileglob returns a comma-separated string of files matching the search string. If you append wantlist=True you'll get a real list. delegate_to: localhost lets you search on the host you're running Ansible on.

- hosts: localhost
  remote_user: root

  tasks:
    - name: "Bla"
      debug:
        msg: "{{ lookup('fileglob', '/any/path/files/rpms/*.rpm', wantlist=True) }}"
      delegate_to: localhost