Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to fileglob Documentation #40461

Merged
merged 1 commit into from
May 24, 2018

Conversation

daryltucker
Copy link
Contributor

@daryltucker daryltucker commented May 20, 2018

SUMMARY

Fixed typo and expanded Notes.

I am not aware of this issue being tracked.

ISSUE TYPE
  • Docs Pull Request
COMPONENT NAME

fileglob lookup plugin.

ANSIBLE VERSION
ansible 2.5.3
  config file = None
  configured module search path = [u'/home/daryl/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /mnt/data/src/ansible/.env/lib/python2.7/site-packages/ansible
  executable location = /mnt/data/src/ansible/.env/bin/ansible
  python version = 2.7.15 (default, May  1 2018, 20:16:04) [GCC 7.3.1 20180406]


ADDITIONAL INFORMATION
$ ansible-doc -t lookup fileglob
Before
> FILEGLOB    (/mnt/data/src/ansible/.env/lib/python2.7/site-packages/ansible/plugins/lookup/fileglob.py)

        Matches all files in a single directory, non-recursively, that match a pattern. It calls Python's "glob" library.

OPTIONS (= is mandatory):

= _terms
        path(s) of files to read



NOTES:
      * Patterns ore only supported on files, not directory/paths.

AUTHOR: Michael DeHaan <michael.dehaan@gmail.com>

EXAMPLES:
- name: display content of all .txt files in dir
  debug: msg={{lookup('fileglob', '/my/path/*.txt')}}

- name: Copy each file over that matches the given pattern
  copy:
    src: "{{ item }}"
    dest: "/etc/fooapp/"
    owner: "root"
    mode: 0600
  with_fileglob:
    - "/playbooks/files/fooapp/*"

RETURN VALUES:


  _raw:
    description:
      - content of file(s)
After
> FILEGLOB    (/mnt/data/src/ansible/.env/lib/python2.7/site-packages/ansible/plugins/lookup/fileglob.py)

        Matches all files in a single directory, non-recursively, that match a pattern. It calls Python's "glob" library.

OPTIONS (= is mandatory):

= _terms
        path(s) of files to read



NOTES:
      * Patterns are only supported on files, not directory/paths.
      * Matching is against local system files.

AUTHOR: Michael DeHaan <michael.dehaan@gmail.com>

EXAMPLES:
- name: display content of all .txt files in dir
  debug: msg={{lookup('fileglob', '/my/path/*.txt')}}

- name: Copy each file over that matches the given pattern
  copy:
    src: "{{ item }}"
    dest: "/etc/fooapp/"
    owner: "root"
    mode: 0600
  with_fileglob:
    - "/playbooks/files/fooapp/*"

RETURN VALUES:


  _raw:
    description:
      - content of file(s)

@ansibot ansibot added affects_2.6 This issue/PR affects Ansible v2.6 docs This issue/PR relates to or includes documentation. needs_triage Needs a first human triage before being processed. new_contributor This PR is the first contribution by a new community member. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels May 20, 2018
@jborean93 jborean93 merged commit 5edc464 into ansible:devel May 24, 2018
jborean93 pushed a commit that referenced this pull request May 24, 2018
@jborean93
Copy link
Contributor

Cherry pick to stable-2.5 70a60b6

@samdoran samdoran removed the needs_triage Needs a first human triage before being processed. label May 24, 2018
gothicx pushed a commit to gothicx/ansible that referenced this pull request Jun 9, 2018
jacum pushed a commit to jacum/ansible that referenced this pull request Jun 26, 2018
@ansible ansible locked and limited conversation to collaborators May 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.6 This issue/PR affects Ansible v2.6 docs This issue/PR relates to or includes documentation. new_contributor This PR is the first contribution by a new community member. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants