AnonSec Shell
Server IP : 85.193.89.191  /  Your IP : 3.144.222.209
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 :  /proc/979/cwd/lib/python2.7/site-packages/ansible/plugins/callback/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /proc/979/cwd/lib/python2.7/site-packages/ansible/plugins/callback/splunk.pyo
�
��\c@`s�ddlmZmZmZeZdZdZddlZddl	Z	ddl
Z
ddlZddlmZddl
mZddlmZddlmZdd	lmZd
efd��YZdefd
��YZdS(i(tabsolute_importtdivisiontprint_functionsa
    callback: splunk
    type: aggregate
    short_description: Sends task result events to Splunk HTTP Event Collector
    author: "Stuart Hirst <support@convergingdata.com>"
    description:
      - This callback plugin will send task results as JSON formatted events to a Splunk HTTP collector.
      - The companion Splunk Monitoring & Diagnostics App is available here "https://splunkbase.splunk.com/app/4023/"
      - Credit to "Ryan Currah (@ryancurrah)" for original source upon which this is based.
    version_added: "2.7"
    requirements:
      - Whitelisting this callback plugin
      - 'Create a HTTP Event Collector in Splunk'
      - 'Define the url and token in ansible.cfg'
    options:
      url:
        description: URL to the Splunk HTTP collector source
        env:
          - name: SPLUNK_URL
        ini:
          - section: callback_splunk
            key: url
      authtoken:
        description: Token to authenticate the connection to the Splunk HTTP collector
        env:
          - name: SPLUNK_AUTHTOKEN
        ini:
          - section: callback_splunk
            key: authtoken
s
examples: >
  To enable, add this to your ansible.cfg file in the defaults block
    [defaults]
    callback_whitelist = splunk
  Set the environment variable
    export SPLUNK_URL=http://mysplunkinstance.datapaas.io:8088/services/collector/event
    export SPLUNK_AUTHTOKEN=f23blad6-5965-4537-bf69-5b5a545blabla88
  Set the ansible.cfg variable in the callback_splunk block
    [callback_splunk]
    url = http://mysplunkinstance.datapaas.io:8088/services/collector/event
    authtoken = f23blad6-5965-4537-bf69-5b5a545blabla88
N(tdatetime(tbasename(topen_url(tAnsibleJSONEncoder(tCallbackBasetSplunkHTTPCollectorSourcecB`seZd�Zd�ZRS(cC`sjt|_d|_d|_ttj��|_tj	�|_
tjtj	��|_t
j�|_dS(Nt(tFalsetansible_check_modetansible_playbooktansible_versiontstrtuuidtuuid4tsessiontsockettgethostnamethostt
gethostbynamet
ip_addresstgetpasstgetusertuser(tself((sC/usr/lib/python2.7/site-packages/ansible/plugins/callback/splunk.pyt__init__Os			c	C`s�|jdjd�tkr(t|_n|jdjd�rZ|jdjd�|_n|jjr{t|jj�}nd}i}|jj	|d<|j
|d<||d<tj�j
d�|d<|j|d	<|j|d
<|j|d<||d<|j|d
<|j|d<|jj|d<|j|d<||d<|j|d<|j|d<tj|dtdt�}d|d}t||didd6d|d6dd�dS(Ntargst_ansible_check_modet_ansible_versionRRtstatuss%Y-%m-%d %H:%M:%S +0000t	timestampRRRtruntimeR
Rtansible_hostRtansible_roletansible_tasktansible_resulttclst	sort_keyss	{"event":t}theaderssapplication/jsonsContent-typesSplunk t
AuthorizationtmethodtPOST(t_task_fieldstgettTrueRR
t_taskt_roleRtNonet_uuidRRtutcnowtstrftimeRRRt_hosttnameRt_resulttjsontdumpsRR(	Rturlt	authtokentstatetresultR!R#tdatatjsondata((sC/usr/lib/python2.7/site-packages/ansible/plugins/callback/splunk.pyt
send_eventXs@











(t__name__t
__module__RRA(((sC/usr/lib/python2.7/site-packages/ansible/plugins/callback/splunk.pyRNs		tCallbackModulecB`s�eZdZdZdZeZdd�Zd�Z	dddd�Z
d�Zd�Zd�Z
d	�Zd
�Zd�Zd�Zd
�ZRS(g@t	aggregatetsplunkcC`sDtt|�jd|�i|_d|_d|_t�|_dS(Ntdisplay(	tsuperRDRtstart_datetimesR2R;R<RRF(RRG((sC/usr/lib/python2.7/site-packages/ansible/plugins/callback/splunk.pyR�s
			cC`s!tj�|j|jjj�S(N(RR4RIR0R3t
total_seconds(RR>((sC/usr/lib/python2.7/site-packages/ansible/plugins/callback/splunk.pyt_runtime�s	cC`s�tt|�jd|d|d|�|jd�|_|jdkrbt|_|jj	d�n|jd�|_
|j
dkr�t|_|jj	d�ndS(Nt	task_keystvar_optionstdirectR;s�Splunk HTTP collector source URL was not provided. The Splunk HTTP collector source URL can be provided using the `SPLUNK_URL` environment variable or in the ansible.cfg file.R<s�Splunk HTTP collector requires an authenticationtoken. The Splunk HTTP collector authentication token can be provided using the `SPLUNK_AUTHTOKEN` environment variable or in the ansible.cfg file.(RHRDtset_optionst
get_optionR;R2R/tdisabledt_displaytwarningR<(RRLRMRN((sC/usr/lib/python2.7/site-packages/ansible/plugins/callback/splunk.pyRO�s%		cC`st|j�|j_dS(N(Rt
_file_nameRFR(Rtplaybook((sC/usr/lib/python2.7/site-packages/ansible/plugins/callback/splunk.pytv2_playbook_on_start�scC`stj�|j|j<dS(N(RR4RIR3(Rttasktis_conditional((sC/usr/lib/python2.7/site-packages/ansible/plugins/callback/splunk.pytv2_playbook_on_task_start�scC`stj�|j|j<dS(N(RR4RIR3(RRW((sC/usr/lib/python2.7/site-packages/ansible/plugins/callback/splunk.pyt!v2_playbook_on_handler_task_start�scK`s/|jj|j|jd||j|��dS(NtOK(RFRAR;R<RK(RR>tkwargs((sC/usr/lib/python2.7/site-packages/ansible/plugins/callback/splunk.pytv2_runner_on_ok�s	cK`s/|jj|j|jd||j|��dS(NtSKIPPED(RFRAR;R<RK(RR>R\((sC/usr/lib/python2.7/site-packages/ansible/plugins/callback/splunk.pytv2_runner_on_skipped�s	cK`s/|jj|j|jd||j|��dS(NtFAILED(RFRAR;R<RK(RR>R\((sC/usr/lib/python2.7/site-packages/ansible/plugins/callback/splunk.pytv2_runner_on_failed�s	cK`s/|jj|j|jd||j|��dS(NR`(RFRAR;R<RK(RR>R\((sC/usr/lib/python2.7/site-packages/ansible/plugins/callback/splunk.pytrunner_on_async_failed�s	cK`s/|jj|j|jd||j|��dS(NtUNREACHABLE(RFRAR;R<RK(RR>R\((sC/usr/lib/python2.7/site-packages/ansible/plugins/callback/splunk.pytv2_runner_on_unreachable�s	N(RBRCtCALLBACK_VERSIONt
CALLBACK_TYPEt
CALLBACK_NAMER/tCALLBACK_NEEDS_WHITELISTR2RRKRORVRYRZR]R_RaRbRd(((sC/usr/lib/python2.7/site-packages/ansible/plugins/callback/splunk.pyRD�s												(t
__future__RRRttypet
__metaclass__t
DOCUMENTATIONtEXAMPLESR9RRRRtos.pathRtansible.module_utils.urlsRtansible.parsing.ajsonRtansible.plugins.callbackRtobjectRRD(((sC/usr/lib/python2.7/site-packages/ansible/plugins/callback/splunk.pyt<module>s8

Anon7 - 2022
AnonSec Team