diff --git a/plugins/lookup/dig.py b/plugins/lookup/dig.py index aeafc40ce6..6d6dca1483 100644 --- a/plugins/lookup/dig.py +++ b/plugins/lookup/dig.py @@ -77,7 +77,7 @@ EXAMPLES = """ RETURN = """ _list: description: - - list of composed strings or dictonaries with key and value + - list of composed strings or dictionaries with key and value If a dictionary, fields shows the keys returned depending on query type contains: ALL: diff --git a/plugins/lookup/filetree.py b/plugins/lookup/filetree.py index fec6cb479d..7d088a543d 100644 --- a/plugins/lookup/filetree.py +++ b/plugins/lookup/filetree.py @@ -4,7 +4,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -DOCUMENTATION = ''' +DOCUMENTATION = r''' lookup: filetree author: Dag Wieers (@dagwieers) short_description: recursively match all files in a directory tree @@ -19,7 +19,7 @@ options: required: True ''' -EXAMPLES = """ +EXAMPLES = r""" - name: Create directories ansible.builtin.file: path: /web/{{ item.path }} @@ -45,46 +45,50 @@ EXAMPLES = """ mode: '{{ item.mode }}' with_community.general.filetree: web/ when: item.state == 'link' + +- name: list all files under web/ + ansible.builtin.debug: + msg: "{{ lookup('community.general.filetree', 'web/') }}" """ -RETURN = """ +RETURN = r""" _raw: description: list of dictionaries with file information contains: src: description: - - full path to file - - not returned when C(item.state) is set to C(directory) + - full path to file. + - not returned when C(item.state) is set to C(directory). root: - description: allows filtering by original location + description: allows filtering by original location. path: - description: contains the relative path to root + description: contains the relative path to root. mode: - description: TODO + description: The permissions the resulting file or directory. state: description: TODO owner: - description: TODO + description: Name of the user that owns the file/directory. group: - description: TODO + description: Name of the group that owns the file/directory. seuser: - description: TODO + description: The user part of the SELinux file context. serole: - description: TODO + description: The role part of the SELinux file context. setype: - description: TODO + description: The type part of the SELinux file context. selevel: - description: TODO + description: The level part of the SELinux file context. uid: - description: TODO + description: Owner ID of the file/directory. gid: - description: TODO + description: Group ID of the file/directory. size: - description: TODO + description: Size of the target. mtime: - description: TODO + description: Time of last modification. ctime: - description: TODO + description: Time of last metadata update or creation (depends on OS). """ import os import pwd