Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/system/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/system/getent.pyc

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zdd
l	Z	ddl
mZddlm
Z
d
�Zedkr�e�nd
S(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontstableinterfacetstatustcoretsupported_bys/
---
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).
        required: True
    key:
        description:
            - Key from which to return values from the specified database, otherwise the
              full contents are returned.
        default: ''
    service:
        description:
            - Override all databases with the specified service
            - The underlying system must support the service flag which is not always available.
        version_added: "2.9"
    split:
        description:
            - "Character used to split the database values into lists/arrays such as ':' or '	', otherwise  it will try to pick one depending on the database."
    fail_key:
        description:
            - If a supplied key is missing this will make the task fail if C(yes).
        type: bool
        default: 'yes'

notes:
   - Not all databases support enumeration, check system documentation for details.
author:
- Brian Coca (@bcoca)
s@
# get root user info
- getent:
    database: passwd
    key: root
- debug:
    var: getent_passwd

# get all groups
- getent:
    database: group
    split: ':'
- debug:
    var: getent_group

# get all hosts, split by tab
- getent:
    database: hosts
- debug:
    var: getent_hosts

# get http service info, no error if missing
- getent:
    database: services
    key: http
    fail_key: False
- debug:
    var: getent_services

# get user password hash (requires sudo/root)
- getent:
    database: shadow
    key: www-data
    split: ':'
- debug:
    var: getent_shadow

N(t
AnsibleModule(t	to_nativecC`s�tdtdtdddt�dtdd�dtdd�dtdd�d	tdd
dt��dt�}d
dddg}|jd}|jjd�}|jjd�}|jjd�}|jjd	�}|jdt�}|dk	r|||g}n||g}|dk	r4|jd|g�n|dkrU||krUd}ny|j|�\}	}
}Wn5t	k
r�}|j
dt|�dtj
��nXd}
d|}ii|6}|	dkr!x9|
j�D]+}|j|�}|d|||d<q�W|jd|�nl|	dkr6d}
nW|	dkrxd}
|s�d|||<|jd|d|
�q�n|	dkr�d}
n|j
d|
�dS( Nt
argument_spectdatabasettypetstrtrequiredtkeytservicetsplittfail_keytbooltdefaulttsupports_check_modetpasswdtshadowtgrouptgshadowtgetents-st:tmsgt	exceptionsUnexpected failure!s	getent_%siit
ansible_factss'Missing arguments, or database unknown.is<One or more supplied key could not be found in the database.is+Enumeration not supported on this database.(RtdicttTruetparamstgettget_bin_pathtNonetextendtrun_commandt	Exceptiont	fail_jsonR	t	tracebackt
format_exct
splitlinesRt	exit_json(tmoduletcolonRRRRRt
getent_bintcmdtrctoutterrteRtdbtreetresultstlinetrecord((sA/usr/lib/python2.7/site-packages/ansible/modules/system/getent.pytmainasX	
	&

		t__main__(t
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLESR)tansible.module_utils.basicRtansible.module_utils._textR	R9t__name__(((sA/usr/lib/python2.7/site-packages/ansible/modules/system/getent.pyt<module>s


''	>

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]