����JFIF��������� Mr.X
  
  __  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

deexcl@216.73.217.71: ~ $
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

from __future__ import absolute_import, division, print_function
__metaclass__ = type


DOCUMENTATION = r'''
---
module: stat
version_added: "1.3"
short_description: Retrieve file or file system status
description:
     - Retrieves facts for a file similar to the Linux/Unix 'stat' command.
     - For Windows targets, use the M(ansible.windows.win_stat) module instead.
options:
  path:
    description:
      - The full path of the file/object to get the facts of.
    type: path
    required: true
    aliases: [ dest, name ]
  follow:
    description:
      - Whether to follow symlinks.
    type: bool
    default: no
  get_checksum:
    description:
      - Whether to return a checksum of the file.
    type: bool
    default: yes
    version_added: "1.8"
  checksum_algorithm:
    description:
      - Algorithm to determine checksum of file.
      - Will throw an error if the host is unable to use specified algorithm.
      - The remote host has to support the hashing method specified, C(md5)
        can be unavailable if the host is FIPS-140 compliant.
    type: str
    choices: [ md5, sha1, sha224, sha256, sha384, sha512 ]
    default: sha1
    aliases: [ checksum, checksum_algo ]
    version_added: "2.0"
  get_mime:
    description:
      - Use file magic and return data about the nature of the file. this uses
        the 'file' utility found on most Linux/Unix systems.
      - This will add both C(mimetype) and C(charset) fields to the return, if possible.
      - In Ansible 2.3 this option changed from I(mime) to I(get_mime) and the default changed to C(true).
    type: bool
    default: yes
    aliases: [ mime, mime_type, mime-type ]
    version_added: "2.1"
  get_attributes:
    description:
      - Get file attributes using lsattr tool if present.
    type: bool
    default: yes
    aliases: [ attr, attributes ]
    version_added: "2.3"
extends_documentation_fragment:
  -  action_common_attributes
attributes:
    check_mode:
        support: full
    diff_mode:
        support: none
    platform:
        platforms: posix
seealso:
- module: ansible.builtin.file
- module: ansible.windows.win_stat
author: Bruce Pennypacker (@bpennypacker)
'''

EXAMPLES = r'''
# Obtain the stats of /etc/foo.conf, and check that the file still belongs
# to 'root'. Fail otherwise.
- name: Get stats of a file
  ansible.builtin.stat:
    path: /etc/foo.conf
  register: st
- name: Fail if the file does not belong to 'root'
  ansible.builtin.fail:
    msg: "Whoops! file ownership has changed"
  when: st.stat.pw_name != 'root'

# Determine if a path exists and is a symlink. Note that if the path does
# not exist, and we test sym.stat.islnk, it will fail with an error. So
# therefore, we must test whether it is defined.
# Run this to understand the structure, the skipped ones do not pass the
# check performed by 'when'
- name: Get stats of the FS object
  ansible.builtin.stat:
    path: /path/to/something
  register: sym

- name: Print a debug message
  ansible.builtin.debug:
    msg: "islnk isn't defined (path doesn't exist)"
  when: sym.stat.islnk is not defined

- name: Print a debug message
  ansible.builtin.debug:
    msg: "islnk is defined (path must exist)"
  when: sym.stat.islnk is defined

- name: Print a debug message
  ansible.builtin.debug:
    msg: "Path exists and is a symlink"
  when: sym.stat.islnk is defined and sym.stat.islnk

- name: Print a debug message
  ansible.builtin.debug:
    msg: "Path exists and isn't a symlink"
  when: sym.stat.islnk is defined and sym.stat.islnk == False


# Determine if a path exists and is a directory.  Note that we need to test
# both that p.stat.isdir actually exists, and also that it's set to true.
- name: Get stats of the FS object
  ansible.builtin.stat:
    path: /path/to/something
  register: p
- name: Print a debug message
  ansible.builtin.debug:
    msg: "Path exists and is a directory"
  when: p.stat.isdir is defined and p.stat.isdir

- name: Do not calculate the checksum
  ansible.builtin.stat:
    path: /path/to/myhugefile
    get_checksum: no

- name: Use sha256 to calculate the checksum
  ansible.builtin.stat:
    path: /path/to/something
    checksum_algorithm: sha256
'''

RETURN = r'''
stat:
    description: Dictionary containing all the stat data, some platforms might add additional fields.
    returned: success
    type: complex
    contains:
        exists:
            description: If the destination path actually exists or not
            returned: success
            type: bool
            sample: True
        path:
            description: The full path of the file/object to get the facts of
            returned: success and if path exists
            type: str
            sample: '/path/to/file'
        mode:
            description: Unix permissions of the file in octal representation as a string
            returned: success, path exists and user can read stats
            type: str
            sample: 1755
        isdir:
            description: Tells you if the path is a directory
            returned: success, path exists and user can read stats
            type: bool
            sample: False
        ischr:
            description: Tells you if the path is a character device
            returned: success, path exists and user can read stats
            type: bool
            sample: False
        isblk:
            description: Tells you if the path is a block device
            returned: success, path exists and user can read stats
            type: bool
            sample: False
        isreg:
            description: Tells you if the path is a regular file
            returned: success, path exists and user can read stats
            type: bool
            sample: True
        isfifo:
            description: Tells you if the path is a named pipe
            returned: success, path exists and user can read stats
            type: bool
            sample: False
        islnk:
            description: Tells you if the path is a symbolic link
            returned: success, path exists and user can read stats
            type: bool
            sample: False
        issock:
            description: Tells you if the path is a unix domain socket
            returned: success, path exists and user can read stats
            type: bool
            sample: False
        uid:
            description: Numeric id representing the file owner
            returned: success, path exists and user can read stats
            type: int
            sample: 1003
        gid:
            description: Numeric id representing the group of the owner
            returned: success, path exists and user can read stats
            type: int
            sample: 1003
        size:
            description: Size in bytes for a plain file, amount of data for some special files
            returned: success, path exists and user can read stats
            type: int
            sample: 203
        inode:
            description: Inode number of the path
            returned: success, path exists and user can read stats
            type: int
            sample: 12758
        dev:
            description: Device the inode resides on
            returned: success, path exists and user can read stats
            type: int
            sample: 33
        nlink:
            description: Number of links to the inode (hard links)
            returned: success, path exists and user can read stats
            type: int
            sample: 1
        atime:
            description: Time of last access
            returned: success, path exists and user can read stats
            type: float
            sample: 1424348972.575
        mtime:
            description: Time of last modification
            returned: success, path exists and user can read stats
            type: float
            sample: 1424348972.575
        ctime:
            description: Time of last metadata update or creation (depends on OS)
            returned: success, path exists and user can read stats
            type: float
            sample: 1424348972.575
        wusr:
            description: Tells you if the owner has write permission
            returned: success, path exists and user can read stats
            type: bool
            sample: True
        rusr:
            description: Tells you if the owner has read permission
            returned: success, path exists and user can read stats
            type: bool
            sample: True
        xusr:
            description: Tells you if the owner has execute permission
            returned: success, path exists and user can read stats
            type: bool
            sample: True
        wgrp:
            description: Tells you if the owner's group has write permission
            returned: success, path exists and user can read stats
            type: bool
            sample: False
        rgrp:
            description: Tells you if the owner's group has read permission
            returned: success, path exists and user can read stats
            type: bool
            sample: True
        xgrp:
            description: Tells you if the owner's group has execute permission
            returned: success, path exists and user can read stats
            type: bool
            sample: True
        woth:
            description: Tells you if others have write permission
            returned: success, path exists and user can read stats
            type: bool
            sample: False
        roth:
            description: Tells you if others have read permission
            returned: success, path exists and user can read stats
            type: bool
            sample: True
        xoth:
            description: Tells you if others have execute permission
            returned: success, path exists and user can read stats
            type: bool
            sample: True
        isuid:
            description: Tells you if the invoking user's id matches the owner's id
            returned: success, path exists and user can read stats
            type: bool
            sample: False
        isgid:
            description: Tells you if the invoking user's group id matches the owner's group id
            returned: success, path exists and user can read stats
            type: bool
            sample: False
        lnk_source:
            description: Target of the symlink normalized for the remote filesystem
            returned: success, path exists and user can read stats and the path is a symbolic link
            type: str
            sample: /home/foobar/21102015-1445431274-908472971
        lnk_target:
            description: Target of the symlink.  Note that relative paths remain relative
            returned: success, path exists and user can read stats and the path is a symbolic link
            type: str
            sample: ../foobar/21102015-1445431274-908472971
            version_added: 2.4
        md5:
            description: md5 hash of the file; this will be removed in Ansible 2.9 in
                favor of the checksum return value
            returned: success, path exists and user can read stats and path
                supports hashing and md5 is supported
            type: str
            sample: f88fa92d8cf2eeecf4c0a50ccc96d0c0
        checksum:
            description: hash of the file
            returned: success, path exists, user can read stats, path supports
                hashing and supplied checksum algorithm is available
            type: str
            sample: 50ba294cdf28c0d5bcde25708df53346825a429f
        pw_name:
            description: User name of owner
            returned: success, path exists, user can read stats, owner name can be looked up and installed python supports it
            type: str
            sample: httpd
        gr_name:
            description: Group name of owner
            returned: success, path exists, user can read stats, owner group can be looked up and installed python supports it
            type: str
            sample: www-data
        mimetype:
            description: file magic data or mime-type
            returned: success, path exists and user can read stats and
                installed python supports it and the I(get_mime) option was true, will
                return C(unknown) on error.
            type: str
            sample: application/pdf; charset=binary
        charset:
            description: file character set or encoding
            returned: success, path exists and user can read stats and
                installed python supports it and the I(get_mime) option was true, will
                return C(unknown) on error.
            type: str
            sample: us-ascii
        readable:
            description: Tells you if the invoking user has the right to read the path
            returned: success, path exists and user can read the path
            type: bool
            sample: False
            version_added: 2.2
        writeable:
            description: Tells you if the invoking user has the right to write the path
            returned: success, path exists and user can write the path
            type: bool
            sample: False
            version_added: 2.2
        executable:
            description: Tells you if the invoking user has execute permission on the path
            returned: success, path exists and user can execute the path
            type: bool
            sample: False
            version_added: 2.2
        attributes:
            description: list of file attributes
            returned: success, path exists and user can execute the path
            type: list
            sample: [ immutable, extent ]
            version_added: 2.3
        version:
            description: The version/generation attribute of a file according to the filesystem
            returned: success, path exists, user can execute the path, lsattr is available and filesystem supports
            type: str
            sample: "381700746"
            version_added: 2.3
'''

import errno
import grp
import os
import pwd
import stat

# import module snippets
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils._text import to_bytes


def format_output(module, path, st):
    mode = st.st_mode

    # back to ansible
    output = dict(
        exists=True,
        path=path,
        mode="%04o" % stat.S_IMODE(mode),
        isdir=stat.S_ISDIR(mode),
        ischr=stat.S_ISCHR(mode),
        isblk=stat.S_ISBLK(mode),
        isreg=stat.S_ISREG(mode),
        isfifo=stat.S_ISFIFO(mode),
        islnk=stat.S_ISLNK(mode),
        issock=stat.S_ISSOCK(mode),
        uid=st.st_uid,
        gid=st.st_gid,
        size=st.st_size,
        inode=st.st_ino,
        dev=st.st_dev,
        nlink=st.st_nlink,
        atime=st.st_atime,
        mtime=st.st_mtime,
        ctime=st.st_ctime,
        wusr=bool(mode & stat.S_IWUSR),
        rusr=bool(mode & stat.S_IRUSR),
        xusr=bool(mode & stat.S_IXUSR),
        wgrp=bool(mode & stat.S_IWGRP),
        rgrp=bool(mode & stat.S_IRGRP),
        xgrp=bool(mode & stat.S_IXGRP),
        woth=bool(mode & stat.S_IWOTH),
        roth=bool(mode & stat.S_IROTH),
        xoth=bool(mode & stat.S_IXOTH),
        isuid=bool(mode & stat.S_ISUID),
        isgid=bool(mode & stat.S_ISGID),
    )

    # Platform dependent flags:
    for other in [
            # Some Linux
            ('st_blocks', 'blocks'),
            ('st_blksize', 'block_size'),
            ('st_rdev', 'device_type'),
            ('st_flags', 'flags'),
            # Some Berkley based
            ('st_gen', 'generation'),
            ('st_birthtime', 'birthtime'),
            # RISCOS
            ('st_ftype', 'file_type'),
            ('st_attrs', 'attrs'),
            ('st_obtype', 'object_type'),
            # macOS
            ('st_rsize', 'real_size'),
            ('st_creator', 'creator'),
            ('st_type', 'file_type'),
    ]:
        if hasattr(st, other[0]):
            output[other[1]] = getattr(st, other[0])

    return output


def main():
    module = AnsibleModule(
        argument_spec=dict(
            path=dict(type='path', required=True, aliases=['dest', 'name']),
            follow=dict(type='bool', default=False),
            get_md5=dict(type='bool', default=False),
            get_checksum=dict(type='bool', default=True),
            get_mime=dict(type='bool', default=True, aliases=['mime', 'mime_type', 'mime-type']),
            get_attributes=dict(type='bool', default=True, aliases=['attr', 'attributes']),
            checksum_algorithm=dict(type='str', default='sha1',
                                    choices=['md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512'],
                                    aliases=['checksum', 'checksum_algo']),
        ),
        supports_check_mode=True,
    )

    path = module.params.get('path')
    b_path = to_bytes(path, errors='surrogate_or_strict')
    follow = module.params.get('follow')
    get_mime = module.params.get('get_mime')
    get_attr = module.params.get('get_attributes')
    get_checksum = module.params.get('get_checksum')
    checksum_algorithm = module.params.get('checksum_algorithm')

    # NOTE: undocumented option since 2.9 to be removed at a later date if possible (3.0+)
    # no real reason for keeping other than fear we may break older content.
    get_md5 = module.params.get('get_md5')

    # main stat data
    try:
        if follow:
            st = os.stat(b_path)
        else:
            st = os.lstat(b_path)
    except OSError as e:
        if e.errno == errno.ENOENT:
            output = {'exists': False}
            module.exit_json(changed=False, stat=output)

        module.fail_json(msg=e.strerror)

    # process base results
    output = format_output(module, path, st)

    # resolved permissions
    for perm in [('readable', os.R_OK), ('writeable', os.W_OK), ('executable', os.X_OK)]:
        output[perm[0]] = os.access(b_path, perm[1])

    # symlink info
    if output.get('islnk'):
        output['lnk_source'] = os.path.realpath(b_path)
        output['lnk_target'] = os.readlink(b_path)

    try:  # user data
        pw = pwd.getpwuid(st.st_uid)
        output['pw_name'] = pw.pw_name
    except (TypeError, KeyError):
        pass

    try:  # group data
        grp_info = grp.getgrgid(st.st_gid)
        output['gr_name'] = grp_info.gr_name
    except (KeyError, ValueError, OverflowError):
        pass

    # checksums
    if output.get('isreg') and output.get('readable'):

        # NOTE: see above about get_md5
        if get_md5:
            # Will fail on FIPS-140 compliant systems
            try:
                output['md5'] = module.md5(b_path)
            except ValueError:
                output['md5'] = None

        if get_checksum:
            output['checksum'] = module.digest_from_file(b_path, checksum_algorithm)

    # try to get mime data if requested
    if get_mime:
        output['mimetype'] = output['charset'] = 'unknown'
        mimecmd = module.get_bin_path('file')
        if mimecmd:
            mimecmd = [mimecmd, '--mime-type', '--mime-encoding', b_path]
            try:
                rc, out, err = module.run_command(mimecmd)
                if rc == 0:
                    mimetype, charset = out.rsplit(':', 1)[1].split(';')
                    output['mimetype'] = mimetype.strip()
                    output['charset'] = charset.split('=')[1].strip()
            except Exception:
                pass

    # try to get attr data
    if get_attr:
        output['version'] = None
        output['attributes'] = []
        output['attr_flags'] = ''
        out = module.get_file_attributes(b_path)
        for x in ('version', 'attributes', 'attr_flags'):
            if x in out:
                output[x] = out[x]

    module.exit_json(changed=False, stat=output)


if __name__ == '__main__':
    main()

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
__init__.py File 0 B 0644
_include.py File 3.06 KB 0644
add_host.py File 3.82 KB 0644
apt.py File 57.4 KB 0644
apt_key.py File 17.45 KB 0644
apt_repository.py File 28.39 KB 0644
assemble.py File 8.76 KB 0644
assert.py File 2.75 KB 0644
async_status.py File 4.29 KB 0644
async_wrapper.py File 11.43 KB 0644
blockinfile.py File 13.29 KB 0644
command.py File 12.64 KB 0644
copy.py File 34.75 KB 0644
cron.py File 25.57 KB 0644
debconf.py File 7.55 KB 0644
debug.py File 2.89 KB 0644
dnf.py File 58.16 KB 0644
dpkg_selections.py File 2.35 KB 0644
expect.py File 8.33 KB 0644
fail.py File 1.67 KB 0644
fetch.py File 4.17 KB 0644
file.py File 39.93 KB 0644
find.py File 18.73 KB 0644
gather_facts.py File 2.5 KB 0644
get_url.py File 26.22 KB 0644
getent.py File 5.56 KB 0644
git.py File 55.22 KB 0644
group.py File 19.57 KB 0644
group_by.py File 2.41 KB 0644
hostname.py File 28.12 KB 0644
import_playbook.py File 2.06 KB 0644
import_role.py File 3.27 KB 0644
import_tasks.py File 2.14 KB 0644
include_role.py File 4.15 KB 0644
include_tasks.py File 2.64 KB 0644
include_vars.py File 6.45 KB 0644
iptables.py File 32.27 KB 0644
known_hosts.py File 13.5 KB 0644
lineinfile.py File 23.39 KB 0644
meta.py File 5.84 KB 0644
package.py File 3.33 KB 0644
package_facts.py File 17.71 KB 0644
pause.py File 3.44 KB 0644
ping.py File 2.32 KB 0644
pip.py File 30 KB 0644
raw.py File 3.57 KB 0644
reboot.py File 4.64 KB 0644
replace.py File 11.19 KB 0644
rpm_key.py File 8.48 KB 0644
script.py File 4.03 KB 0644
service.py File 63.85 KB 0644
service_facts.py File 16.73 KB 0644
set_fact.py File 5.62 KB 0644
set_stats.py File 2.6 KB 0644
setup.py File 10.79 KB 0644
shell.py File 6.57 KB 0644
slurp.py File 3.19 KB 0644
stat.py File 19.62 KB 0644
subversion.py File 13.22 KB 0644
systemd.py File 22.82 KB 0644
systemd_service.py File 22.82 KB 0644
sysvinit.py File 13.47 KB 0644
tempfile.py File 3.42 KB 0644
template.py File 3.1 KB 0644
unarchive.py File 42.79 KB 0644
uri.py File 27.78 KB 0644
user.py File 114.18 KB 0644
validate_argument_spec.py File 2.99 KB 0644
wait_for.py File 25.91 KB 0644
wait_for_connection.py File 3.38 KB 0644
yum.py File 72.05 KB 0644
yum_repository.py File 24.82 KB 0644