AnonSec Shell
Server IP : 85.193.89.191  /  Your IP : 18.223.172.181
Web Server : Apache
System : Linux 956367-cx40159.tmweb.ru 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64
User : bitrix ( 600)
PHP Version : 8.1.27
Disable Function : NONE
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python2.7/site-packages/ansible/plugins/callback/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /lib/python2.7/site-packages/ansible/plugins/callback/logentries.pyc
�
��\c@`sxddlmZmZmZeZdZdZddlZddl	Z	ddl
Z
ddlZddlZyddl
Z
eZWnek
r�eZnXyddlZeZWnek
r�eZnXddlmZmZmZddlmZdefd��YZyddlZeZWnek
rAeZeZnXd	efd
��YZeZdefd��YZ dS(
i(tabsolute_importtdivisiontprint_functions~
    callback: logentries
    type: notification
    short_description: Sends events to Logentries
    description:
      - This callback plugin will generate JSON objects and send them to Logentries via TCP for auditing/debugging purposes.
      - Before 2.4, if you wanted to use an ini configuration, the file must be placed in the same directory as this plugin and named logentries.ini
      - In 2.4 and above you can just put it in the main Ansible configuration file.
    version_added: "2.0"
    requirements:
      - whitelisting in configuration
      - certifi (python library)
      - flatdict (pytnon library), if you want to use the 'flatten' option
    options:
      api:
        description: URI to the Logentries API
        env:
          - name: LOGENTRIES_API
        default: data.logentries.com
        ini:
          - section: callback_logentries
            key: api
      port:
        description: Http port to use when connecting to the API
        env:
            - name: LOGENTRIES_PORT
        default: 80
        ini:
          - section: callback_logentries
            key: port
      tls_port:
        description: Port to use when connecting to the API when TLS is enabled
        env:
            - name: LOGENTRIES_TLS_PORT
        default: 443
        ini:
          - section: callback_logentries
            key: tls_port
      token:
        description: The logentries "TCP token"
        env:
          - name: LOGENTRIES_ANSIBLE_TOKEN
        required: True
        ini:
          - section: callback_logentries
            key: token
      use_tls:
        description:
          - Toggle to decidewhether to use TLS to encrypt the communications with the API server
        env:
          - name: LOGENTRIES_USE_TLS
        default: False
        type: boolean
        ini:
          - section: callback_logentries
            key: use_tls
      flatten:
        description: flatten complex data structures into a single dictionary with complex keys
        type: boolean
        default: False
        env:
          - name: LOGENTRIES_FLATTEN
        ini:
          - section: callback_logentries
            key: flatten
s 
examples: >
  To enable, add this to your ansible.cfg file in the defaults block

    [defaults]
    callback_whitelist = logentries

  Either set the environment variables
    export LOGENTRIES_API=data.logentries.com
    export LOGENTRIES_PORT=10000
    export LOGENTRIES_ANSIBLE_TOKEN=dd21fc88-f00a-43ff-b977-e3a4233c53af

  Or in the main Ansible config file
    [callback_logentries]
    api = data.logentries.com
    port = 10000
    tls_port = 20000
    use_tls = no
    token = dd21fc88-f00a-43ff-b977-e3a4233c53af
    flatten = False
N(tto_bytestto_textt	to_native(tCallbackBasetPlainTextSocketAppendercB`s>eZdddd�Zd�Zd�Zd�Zd�ZRS(sdata.logentries.comiPi�cC`sU||_||_||_d|_d|_d|_d|_||_d|_	dS(Ng�������?i
sG

It appears the LOGENTRIES_TOKEN parameter you entered is incorrect!

u
(
tLE_APItLE_PORTtLE_TLS_PORTt	MIN_DELAYt	MAX_DELAYt
INVALID_TOKENtLINE_SEPt_displaytNonet_conn(tselftdisplayRR	R
((sG/usr/lib/python2.7/site-packages/ansible/plugins/callback/logentries.pyt__init__zs								cC`s;tjtjtj�|_|jj|j|jf�dS(N(tsockettAF_INETtSOCK_STREAMRtconnectRR	(R((sG/usr/lib/python2.7/site-packages/ansible/plugins/callback/logentries.pytopen_connection�scC`s�|j�|j}x�tr�y|j�dSWn-tk
r]}|jjdt|��nX|d9}||jkr�|j}n|t	j
d|�}y%|jjd|�tj|�Wqt
k
r��qXqWdS(Ns#Unable to connect to Logentries: %siissleeping %s before retry(tclose_connectionRtTrueRt	ExceptionRtvvvvtstrRtrandomtuniformttimetsleeptKeyboardInterrupt(Rt
root_delaytetwait_for((sG/usr/lib/python2.7/site-packages/ansible/plugins/callback/logentries.pytreopen_connection�s"
		


cC`s#|jdk	r|jj�ndS(N(RRtclose(R((sG/usr/lib/python2.7/site-packages/ansible/plugins/callback/logentries.pyR�scC`s�t|dd�}|jd|j�}|d7}xOtr�y |jjt|dd��Wn!tjk
r}|j	�q4nXPq4W|j
�dS(Nterrorstsurrogate_or_strictu
(RtreplaceRRRtsendRRterrorR'R(Rtdatat	multiline((sG/usr/lib/python2.7/site-packages/ansible/plugins/callback/logentries.pytput�s
	 
(t__name__t
__module__RRR'RR0(((sG/usr/lib/python2.7/site-packages/ansible/plugins/callback/logentries.pyRys
			tTLSSocketAppendercB`seZd�ZRS(cC`s�tjtjtj�}tjd|dddddtdtjdttdtj	�dt
j�d	td
t�	}|j
|j|jf�||_dS(Ntsocktkeyfiletcertfiletserver_sidet	cert_reqstssl_versiontPROTOCOL_TLSv1_2tca_certstdo_handshake_on_connecttsuppress_ragged_eofs(RRRtssltwrap_socketRtFalset
CERT_REQUIREDtgetattrtPROTOCOL_TLSv1tcertifitwhereRRRR
R(RR4((sG/usr/lib/python2.7/site-packages/ansible/plugins/callback/logentries.pyR�s			(R1R2R(((sG/usr/lib/python2.7/site-packages/ansible/plugins/callback/logentries.pyR3�stCallbackModulecB`s�eZdZdZdZeZd�Zdddd�Z	d�Z
d�Zd�Zd�Z
d	�Zed
�Zdd�Zd�Zd
�Zd�Zd�ZRS(g@tnotificationt
logentriescC`sptt|�j�ts,|jjd�ntsNt|_|jjd�nt	t
j��|_d|_
dS(Ns4Unable to import ssl module. Will send over port 80.sWThe `certifi` python module is not installed.
Disabling the Logentries callback plugin.i
(tsuperRFRtHAS_SSLRtwarningtHAS_CERTIFIRtdisabledRtuuidtuuid4tle_jobidttimeout(R((sG/usr/lib/python2.7/site-packages/ansible/plugins/callback/logentries.pyR�s	cC`s;tt|�jd|d|d|�y^|jd�|_|jd�|_|jd�|_|jd�|_|jd�|_Wn6t	k
r�}|j
jd	t|��t
|_nXy|jd
�|_Wn,t	k
r}|j
jd�t
|_nX|jr-tr-t
|_|j
jd�n|j�dS(
Nt	task_keystvar_optionstdirecttapitportttls_porttuse_tlstflattens1Missing option for Logentries callback plugin: %sttokens[Logentries token was not provided, this is required for this callback to operate, disablingswYou have chosen to flatten and the `flatdict` python module is not installed.
Disabling the Logentries callback plugin.(RIRFtset_optionst
get_optiontapi_urltapi_porttapi_tls_portRXRYtKeyErrorRRKRRRMRZtHAS_FLATDICTt_initialize_connections(RRRRSRTR%((sG/usr/lib/python2.7/site-packages/ansible/plugins/callback/logentries.pyR[�s&%

	cC`s�|js�|jr\|jjd|j|jf�td|jd|jd|j�|_nG|jjd|j|jf�t	d|jd|jd|j�|_|jj
�ndS(NsConnecting to %s:%s with TLSRRR
sConnecting to %s:%sR	(RMRXRRR]R_R3t	_appenderR^RR'(R((sG/usr/lib/python2.7/site-packages/ansible/plugins/callback/logentries.pyRb	s		 * 'cC`sK|jr1tj|�}|j|j|��n|j|j|��dS(N(RYtflatdicttFlatDicttemitt
_dump_results(Rtrecordtresults((sG/usr/lib/python2.7/site-packages/ansible/plugins/callback/logentries.pytemit_formatteds	cC`sH|jd�}dj|j|�}|jj|�|jjd�dS(Ns
s{0} {1}sSent event to logentries(trstriptformatRZRcR0RR(RRhtmsg((sG/usr/lib/python2.7/site-packages/ansible/plugins/callback/logentries.pyRfscC`si|jd6|d6|d6S(NRPthostnameRi(RP(Rthosttres((sG/usr/lib/python2.7/site-packages/ansible/plugins/callback/logentries.pyt	_set_info!scC`s-|j||�}d|d<|j|�dS(NtOKtstatus(RqRj(RRoRpRi((sG/usr/lib/python2.7/site-packages/ansible/plugins/callback/logentries.pytrunner_on_ok$s
cC`s-|j||�}d|d<|j|�dS(NtFAILEDRs(RqRj(RRoRpt
ignore_errorsRi((sG/usr/lib/python2.7/site-packages/ansible/plugins/callback/logentries.pytrunner_on_failed)s
cC`s4|j||�}|d=d|d<|j|�dS(NRitSKIPPEDRs(RqRj(RRotitemRi((sG/usr/lib/python2.7/site-packages/ansible/plugins/callback/logentries.pytrunner_on_skipped.s
cC`s-|j||�}d|d<|j|�dS(NtUNREACHABLERs(RqRj(RRoRpRi((sG/usr/lib/python2.7/site-packages/ansible/plugins/callback/logentries.pytrunner_on_unreachable4s
cC`s7|j||�}||d<d|d<|j|�dS(NtjidtASYNC_FAILEDRs(RqRj(RRoRpR}Ri((sG/usr/lib/python2.7/site-packages/ansible/plugins/callback/logentries.pytrunner_on_async_failed9s

cC`sZi}|j|d<tj�|d<|jr<|j|d<n|j|d<|j|�dS(NRPt
started_bytplaythosts(RPtostgetlogintnameR�Rj(RR�Ri((sG/usr/lib/python2.7/site-packages/ansible/plugins/callback/logentries.pytv2_playbook_on_play_start?s
	
cC`s|jj�dS(s close connection N(RcR(Rtstats((sG/usr/lib/python2.7/site-packages/ansible/plugins/callback/logentries.pytplaybook_on_statsHsN(R1R2tCALLBACK_VERSIONt
CALLBACK_TYPEt
CALLBACK_NAMERtCALLBACK_NEEDS_WHITELISTRRR[RbRjRfRqRtR@RwRzR|RR�R�(((sG/usr/lib/python2.7/site-packages/ansible/plugins/callback/logentries.pyRF�s"										(!t
__future__RRRttypet
__metaclass__t
DOCUMENTATIONtEXAMPLESR�RRR!RNRDRRLtImportErrorR@RdRatansible.module_utils._textRRRtansible.plugins.callbackRtobjectRR>RJtSocketAppenderR3RF(((sG/usr/lib/python2.7/site-packages/ansible/plugins/callback/logentries.pyt<module>s<C





A




Anon7 - 2022
AnonSec Team