1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

filetree: Update example and documentation for plugin (#728)

Fixes: #727

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit ce48751033)
This commit is contained in:
Abhijeet Kasurde 2020-08-04 18:30:41 +05:30 committed by Felix Fontein
parent 75afd83508
commit 402bb01501
2 changed files with 24 additions and 20 deletions

View file

@ -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:

View file

@ -4,7 +4,7 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
DOCUMENTATION = r'''
lookup: filetree
author: Dag Wieers (@dagwieers) <dag@wieers.com>
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