AnonSec Shell
Server IP : 85.193.89.191  /  Your IP : 3.144.34.110
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/strategy/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /lib/python2.7/site-packages/ansible/plugins/strategy/linear.pyo
�
��\c@`s)ddlmZmZmZeZdZddlmZm	Z	ddl
mZddlm
Z
ddlmZddlmZddlmZdd	lmZdd
lmZddlmZddlmZydd
lmZWn*ek
rddlm Z e �ZnXdefd��YZ!dS(i(tabsolute_importtdivisiontprint_functions
    strategy: linear
    short_description: Executes tasks in a linear fashion
    description:
        - Task execution is in lockstep per host batch as defined by C(serial) (default all).
          Up to the fork limit of hosts will execute each task at the same time and then
          the next series of hosts until the batch is done, before going on to the next task.
    version_added: "2.0"
    notes:
     - This was the default Ansible behaviour before 'strategy plugins' were introduced in 2.0.
    author: Ansible Core Team
(tAnsibleErrortAnsibleAssertionError(tPlayIterator(t	iteritems(tto_text(tBlock(tIncludedFile(tTask(t
action_loader(tStrategyBase(tTemplar(tdisplay(tDisplaytStrategyModulecB`s;eZdZd�Zd�Zd�Zd�Zd�ZRS(cC`s�|jdkrtd��ng}x^|D]V}t|t�rS|j|j�q+t|t�r+|j|j||j��q+q+W|S(Ns=strategy.linear.StrategyModule.noop_task is None, need Task()(	t	noop_tasktNoneRt
isinstanceR
tappendRt_create_noop_block_fromt_parent(tselfttargettresulttel((sC/usr/lib/python2.7/site-packages/ansible/plugins/strategy/linear.pyt_replace_with_noop9s
#cC`sRtd|�}|j|j�|_|j|j�|_|j|j�|_|S(Ntparent_block(RRtblocktalwaystrescue(Rtoriginal_blocktparentt
noop_block((sC/usr/lib/python2.7/site-packages/ansible/plugins/strategy/linear.pyREs
cC`sNt�|_d|j_d|jjd<|jj|jj�|j||�S(Ntmetatnoopt_raw_params(R
Rtactiontargst
set_loadert_playt_loaderR(RR R!titerator((sC/usr/lib/python2.7/site-packages/ansible/plugins/strategy/linear.pyt#_prepare_and_create_noop_block_fromMs
c`s�t��d�_d�jd<�j�jj�i�tjd�x*|D]"}�j|dt	��|j
<qLWtjd�d}d}d}d}tjd�gt��D](\}}|r�|d	r�||f^q�}	|	r"y t�fd
�|	D��}
Wq(t
k
rd}
q(Xnd}
x�|	D]�\}}|\}
}�j|
�}
|
j|
krkq/n|
jtjkr�|d	7}q/|
jtjkr�|d	7}q/|
jtjkr�|d	7}q/|
jtjkr/|d	7}q/q/Wtjd||||f����fd�}|rCtjd
�|||
tj�S|ritjd�|||
tj�S|r�tjd�|||
tj�S|r�tjd�|||
tj�Stjd�g|D]}|df^q�S(s�
        Returns a list of (host, task) tuples, where the task may
        be a noop task to keep the iterator in lock step across
        all hosts.
        R#R$R%s%building list of next tasks for hoststpeeksdone building task listsis)counting tasks in each state of executionic3`s?|]5\}\}}|jtjkr�j|�jVqdS(N(t	run_stateRtITERATING_COMPLETEtget_active_statet	cur_block(t.0thtstt(R+(sC/usr/lib/python2.7/site-packages/ansible/plugins/strategy/linear.pys	<genexpr>tssndone counting tasks in each state of execution:
	num_setups: %s
	num_tasks: %s
	num_rescue: %s
	num_always: %sc	`s�g}tjd�x�|D]�}�j|j�}|dkrDqn|\}}�j|�}|dkrqqn|j|kr�|j|kr��j|�}|j	||f�q|j	|�f�qWtjd�|S(s

            This helper returns the task for all hosts in the requested
            state, otherwise they get a noop dummy task. This also advances
            the state of the host, since the given states are determined
            while using peek=True.
            sstarting to advance hostss!done advancing hosts to next taskN(
RtdebugtgettnameRR0R.R1tget_next_task_for_hostR(	thostsR1t	cur_statetrvalsthostthost_state_taskR4R5tnew_t(t
host_tasksR+R(sC/usr/lib/python2.7/site-packages/ansible/plugins/strategy/linear.pyt_advance_selected_hosts�s 	


s"advancing hosts in ITERATING_SETUPs"advancing hosts in ITERATING_TASKSs#advancing hosts in ITERATING_RESCUEs#advancing hosts in ITERATING_ALWAYSs5all hosts are done, so returning None's for all hostsN(R
R&R'R(R)R*RR6R9tTrueR8Rtmint
ValueErrorRR0R1R.RtITERATING_SETUPtITERATING_TASKStITERATING_RESCUEtITERATING_ALWAYS(RR:R+R=t
num_setupst	num_taskst
num_rescuet
num_alwayst
state_taskthost_tasks_to_runtlowest_cur_blocktktvR4R5RA((R@R+RsC/usr/lib/python2.7/site-packages/ansible/plugins/strategy/linear.pyt_get_next_task_lockstepUsp		


 

"









c(C`sj
|jj}t}x9
|rM
|jjrM
y�	tjd�|j|�}tjd�t}t}g}|j||�}t}	t}
t}g}x`|D]X\}
}|s�q�n|jjr�Pnt}t}yt	j
|jdt�}Wntk
rd=}nX|jrd|jj|
�rd|jjd=ksJ|jjrd|jjjrdtjd|�q�qdn|jdkr�|j|j||||
��|jj
dd=�d>kr�t}n|js�|r�|jr�t}q�n�|jr|
r|j|�rt}
qt}	Pntjd	�|jjd
|jd|
d|�}|j|d
|j�td
|jd|�}tjd�|j|j �p�|o�t!|dt�}|js�|r�|jr�t}n|s�tjd�|j"}tjd�y8t#|j|j"dt�dd�|_"tjd�Wntjd�nXtjd�|jj$d|dt�||_"t}tjd�nt|j%|
j&�<|j'|
|||�~|r�Pn||j(|dt)dt*t+|jj,�d���7}q�W|	r�wntjd�|j-d kr1||j.|�7}n|j|�|j/|�y+t0j1|d!|d
|jd"|j�}Wnt2k
r�}|jj3SXt}t+|�d kr1tjd#�tjd$�t4d%�|D��}tjd&�x�|D]�}tjd'|j5�yi|j6r�|j7|�}|j8d
|jd"|jd
|j�\}}|jj9g|D]}|j:D]}|^qnqa�n|j;|d!|�}tjd(�x�|D]�}|jjd
|jd|j<�}tjd)�|j=||�}tjd*�|j>||j<|�} xB|D]:}
|
|j?krK||
j@|�q"||
j@| �q"Wq�Wtjd+�Wq�t2k
r�}x1|j?D]&}
t|jjA|
j"<|jB|
�q�WtjCt#|�d,t�t}q�q�Xq�Wtjd-�x"|D]}
|jD|
||
�q�Wtjd.�tjd/�ntjd0�tjd1�g}!g}"xv|D]n}#|#jE�s�|#jFjdkr�|jE|#jG�r�|!j@|#jGj"�q^|#jH�r^|"j@|#jGj"�q^q^W|r�t+|!�d ks�t+|"�d kr�tI|jJ|jKg�}$x�|D]~}
|jL|
d2t�\}%}&|%jM|$ksq|%jM|jJkr|%jN|jO@d krt|jjA|
j"<||jjPO}qqWntjd3�tjd4�|jjQd=k	r�	t+|�d kr�	|jjQd5}'t+|jjA�|jR|'krq	x@|D]8}
|
j"|!kr	t|jjA|
j"<|jB|
�q	q	W|jj$d6�||jjPO}ntjd7t+|jjA�|jR|'f�ntjd8�tjd9�||jjkr
t+|jjA�t+|�kr
tjd:�|jj$d6�|Stjd;�WqtStTfk
rI
}tjd<|�|jjUSXqWtVtW|�jX|||�S(?s�
        The linear strategy is simple - get the next task and queue
        it for all hosts, then wait for the queue to drain before
        moving on to the next task
        s)getting the remaining hosts for this loops.done getting the remaining hosts for this loopt
class_onlys)'%s' skipped because role has already runR#R%R$treset_connectionsgetting variablestplayR=ttasktloadert	variablessdone getting variablestBYPASS_HOST_LOOPsOsending task start callback, copying the task so we can template it temporarilys#done copying, going to template nowtfail_on_undefinedt	nonstringtemptysdone templatings!templating failed for some reasonshere goes the callback...tv2_playbook_on_task_starttis_conditionalssending task start callbackt
max_passesig�������?s>done queuing things up, now waiting for results queue to drainiR+tvariable_managers!we have included files to processsgenerating all_blocks datacs`s|]}|gfVqdS(N((R2R=((sC/usr/lib/python2.7/site-packages/ansible/plugins/strategy/linear.pys	<genexpr>[ssdone generating all_blocks datasprocessing included file: %ss2iterating over new_blocks loaded from include filesfiltering new block on tagss done filtering new block on tagss7done iterating over new_blocks loaded from include filet	wrap_texts7extending task lists for all hosts with included blockssdone extending task listssdone processing included filessresults queue emptyschecking for any_errors_fatalR-s"done checking for any_errors_fatals checking for max_fail_percentagegY@t!v2_playbook_on_no_hosts_remainings$(%s failed / %s total )> %s max fails%done checking for max_fail_percentagesIchecking to see if all hosts have failed and the running result is not oks!^ not ok, so returning result nows-done checking to see if all hosts have faileds%got IOError/EOFError in task loop: %sN(snoopRT(Yt_tqmtRUN_OKRBt_terminatedRR6tget_hosts_lefttFalseRRRR7R&tKeyErrorRt_rolethas_runt	_metadatatallow_duplicatestextendt
_execute_metaR'tany_errors_fatalt
ignore_errorst_stept
_take_stept_variable_managertget_varsR)tadd_tqm_variablesR
R*ttemplatetrun_oncetgetattrR8Rt
send_callbackt_blocked_hoststget_namet_queue_taskt_process_pending_resultstmaxtinttlent_workerst_pending_resultst_wait_on_pending_resultstupdate_active_connectionsR	tprocess_include_resultsRt	RUN_ERRORtdictt	_filenamet_is_rolet_copy_included_filetget_block_listtupdate_handler_listRt_load_included_fileRtfilter_tagged_tasksR,t_hostsRt
_failed_hoststmark_host_failedterrort	add_taskst	is_failedt_taskt_hosttis_unreachablet	frozensetRGRHR9R.t
fail_statet
FAILED_RESCUEtRUN_FAILED_BREAK_PLAYtmax_fail_percentaget
batch_sizetIOErrortEOFErrortRUN_UNKNOWN_ERRORtsuperRtrun((RR+tplay_contextRt
work_to_dot
hosts_leftt
callback_sentthost_resultsR@t	skip_resttchoose_stepRotresultsR=RVRwR&t	task_varsttemplart
saved_nametincluded_filestetinclude_failuret
all_blockst
included_filetnew_irt
new_blocksthandler_blockst
handler_blockthandlert	new_blocktfinal_blockR"tfailed_hoststunreachable_hoststrestdont_fail_statesR4t_t
percentage((sC/usr/lib/python2.7/site-packages/ansible/plugins/strategy/linear.pyR��sN



.			
$
*	
	
'
	<


	



				6

	








0*
(

$
,

0
N(	t__name__t
__module__RRRRR,RRR�(((sC/usr/lib/python2.7/site-packages/ansible/plugins/strategy/linear.pyR5s				uN("t
__future__RRRttypet
__metaclass__t
DOCUMENTATIONtansible.errorsRRtansible.executor.play_iteratorRtansible.module_utils.sixRtansible.module_utils._textRtansible.playbook.blockRtansible.playbook.included_fileR	tansible.playbook.taskR
tansible.plugins.loaderRtansible.plugins.strategyRtansible.templateR
t__main__RtImportErrortansible.utils.displayRR(((sC/usr/lib/python2.7/site-packages/ansible/plugins/strategy/linear.pyt<module>s$




Anon7 - 2022
AnonSec Team