403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /lib/python3.11/site-packages/ansible/modules/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib/python3.11/site-packages/ansible/modules/__pycache__/getent.cpython-311.opt-1.pyc
�

���c@��t�ddlmZmZmZeZdZdZdZddl	Z	ddl
mZddlm
Z
d�Zed	kre��dSdS)
�)�absolute_import�division�print_functiona�
---
module: getent
short_description: A wrapper to the unix getent utility
description:
     - Runs getent against one of it's various databases and returns information into
       the host's facts, in a getent_<database> prefixed variable.
version_added: "1.8"
options:
    database:
        description:
            - The name of a getent database supported by the target system (passwd, group,
              hosts, etc).
        type: str
        required: True
    key:
        description:
            - Key from which to return values from the specified database, otherwise the
              full contents are returned.
        type: str
        default: ''
    service:
        description:
            - Override all databases with the specified service
            - The underlying system must support the service flag which is not always available.
        type: str
        version_added: "2.9"
    split:
        description:
            - Character used to split the database values into lists/arrays such as C(:) or C(\t),
              otherwise it will try to pick one depending on the database.
        type: str
    fail_key:
        description:
            - If a supplied key is missing this will make the task fail if C(true).
        type: bool
        default: 'yes'
extends_documentation_fragment:
  - action_common_attributes
  - action_common_attributes.facts
attributes:
    check_mode:
        support: full
    diff_mode:
        support: none
    facts:
        support: full
    platform:
        platforms: posix
notes:
   - Not all databases support enumeration, check system documentation for details.
author:
- Brian Coca (@bcoca)
aD
- name: Get root user info
  ansible.builtin.getent:
    database: passwd
    key: root
- ansible.builtin.debug:
    var: ansible_facts.getent_passwd

- name: Get all groups
  ansible.builtin.getent:
    database: group
    split: ':'
- ansible.builtin.debug:
    var: ansible_facts.getent_group

- name: Get all hosts, split by tab
  ansible.builtin.getent:
    database: hosts
- ansible.builtin.debug:
    var: ansible_facts.getent_hosts

- name: Get http service info, no error if missing
  ansible.builtin.getent:
    database: services
    key: http
    fail_key: False
- ansible.builtin.debug:
    var: ansible_facts.getent_services

- name: Get user password hash (requires sudo/root)
  ansible.builtin.getent:
    database: shadow
    key: www-data
    split: ':'
- ansible.builtin.debug:
    var: ansible_facts.getent_shadow

a�
ansible_facts:
  description: Facts to add to ansible_facts.
  returned: always
  type: dict
  contains:
    getent_<database>:
      description:
        - A list of results or a single result as a list of the fields the db provides
        - The list elements depend on the database queried, see getent man page for the structure
        - Starting at 2.11 it now returns multiple duplicate entries, previouslly it only returned the last one
      returned: always
      type: list
N)�
AnsibleModule)�	to_nativec���tttdd���tdd���td���td���tdd����	��d�
��}gd�}|jd}|j�d
��}|j�d��}|j�d��}|j�d��}|�dd��}|�|||g}n||g}|�|�d|g��|�||vrd}	|�|��\}	}
}nL#t$r?}|�t|��tj�����Yd}~nd}~wwxYwd}
d|z}|ii}|	dkr�i}|
���D]�}|�
|��}|d|vr|||ddkr$|||dg|||d<|||d�|dd���||dxxdz
cc<��|dd�|||d<d||d<��|�|���n>|	dkrd}
n5|	dkr'd}
|s"d|||<|�||
���n|	dkrd}
|�|
� ��dS)!N�strT)�type�requiredF)r
�no_log)r
�bool)r
�default)�database�key�service�split�fail_key)�
argument_spec�supports_check_mode)�passwd�shadow�group�gshadowrrrrr�getentz-s�:)�msg�	exceptionzUnexpected failure!z	getent_%sr�)�
ansible_factsz'Missing arguments, or database unknown.�z<One or more supplied key could not be found in the database.)rr�z+Enumeration not supported on this database.)r)r�dict�params�get�get_bin_path�extend�run_command�	Exception�	fail_jsonr�	traceback�
format_exc�
splitlinesr�append�	exit_json)�module�colonrrrrr�
getent_bin�cmd�rc�out�err�er�dbtree�results�seen�line�records                   �;/usr/lib/python3.11/site-packages/ansible/modules/getent.py�mainr=}s\��
���u�t�4�4�4��%��.�.�.��e�$�$�$��E�"�"�"��v�t�4�4�4�
�
�
�!�	�	�	�F�
5�4�4�E��}�Z�(�H�
�-�
�
�E�
"�
"�C��M���g�&�&�E��m���	�*�*�G��}� � ��,�,�H��$�$�X�t�4�4�J�
���8�S�)����8�$�����
�
�D�'�?�#�#�#��}��U�*�*���M��)�)�#�.�.���C�����M�M�M����Y�q�\�\�Y�5I�5K�5K��L�L�L�L�L�L�L�L�����M���� �C�
�8�
#�F��r�l�G�	�Q�w�w����N�N�$�$�
	$�
	$�D��Z�Z��&�&�F��a�y�D� � ���q�	�?�a�'�'�29�&�/�&��)�2L�1M�G�F�O�F�1�I�.�����q�	�*�1�1�&����*�=�=�=��V�A�Y����1�$�����.4�A�B�B�Z�����q�	�*�"#��V�A�Y������w��/�/�/�/�	�q���7���	�q���L���	=�#'�G�F�O�C� ����7���<�<�<��	�q���;��
���������s�*E�
F
�5F�F
�__main__)�
__future__rrrr
�
__metaclass__�
DOCUMENTATION�EXAMPLES�RETURNr*�ansible.module_utils.basicr�ansible.module_utils._textrr=�__name__��r<�<module>rIs���A�@�@�@�@�@�@�@�@�@��
�5�
�n%��N
������4�4�4�4�4�4�0�0�0�0�0�0�G�G�G�T�z����D�F�F�F�F�F��rH

Youez - 2016 - github.com/yon3zu
LinuXploit