HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //lib/python3.9/site-packages/ansible/plugins/lookup/__pycache__/fileglob.cpython-39.pyc
a

�)g��@spddlmZmZmZeZdZdZdZddl	Z	ddl
Z
ddlmZddl
mZddlmZmZGd	d
�d
e�ZdS)�)�absolute_import�division�print_functionad
    name: fileglob
    author: Michael DeHaan
    version_added: "1.4"
    short_description: list files matching a pattern
    description:
        - Matches all files in a single directory, non-recursively, that match a pattern.
          It calls Python's "glob" library.
    options:
      _terms:
        description: path(s) of files to read
        required: True
    notes:
      - Patterns are only supported on files, not directory/paths.
      - See R(Ansible task paths,playbook_task_paths) to understand how file lookup occurs with paths.
      - Matching is against local system files on the Ansible controller.
        To iterate a list of files on a remote node, use the M(ansible.builtin.find) module.
      - Returns a string list of paths joined by commas, or an empty list if no files match. For a 'true list' pass C(wantlist=True) to the lookup.
a_
- name: Display paths of all .txt files in dir
  ansible.builtin.debug: msg={{ lookup('ansible.builtin.fileglob', '/my/path/*.txt') }}

- name: Copy each file over that matches the given pattern
  ansible.builtin.copy:
    src: "{{ item }}"
    dest: "/etc/fooapp/"
    owner: "root"
    mode: 0600
  with_fileglob:
    - "/playbooks/files/fooapp/*"
zS
  _list:
    description:
      - list of files
    type: list
    elements: path
N)�
LookupBase)�AnsibleFileNotFound)�to_bytes�to_textc@seZdZddd�ZdS)�LookupModuleNc

Ks�g}|D]�}tj�|�}g}||krB|�|�|dtj�|���nFd|vrT|d}n|�|�g}|D]"}	|�tj�|	d��|�|	�qd|D]D}
|
r�t�t	tj�|
|�dd��}dd�|D�}|r�|�
|�qq�q|S)N�filesZansible_search_path�surrogate_or_strict��errorscSs$g|]}tj�|�rt|dd��qS)rr)�os�path�isfiler)�.0�g�r�C/usr/lib/python3.9/site-packages/ansible/plugins/lookup/fileglob.py�
<listcomp>P�z$LookupModule.run.<locals>.<listcomp>)rr�basename�appendZfind_file_in_search_path�dirnameZget_basedir�join�globr�extend)
�selfZtermsZ	variables�kwargs�retZtermZ	term_fileZfound_paths�paths�pZdwimmed_pathZglobbedZterm_resultsrrr�run;s(

zLookupModule.run)N)�__name__�
__module__�__qualname__r"rrrrr	9sr	)Z
__future__rrr�typeZ
__metaclass__Z
DOCUMENTATIONZEXAMPLESZRETURNrrZansible.plugins.lookuprZansible.errorsrZansible.module_utils._textrrr	rrrr�<module>s