HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //lib/python3.9/site-packages/ansible/playbook/__pycache__/helpers.cpython-39.pyc
a

�)ghA�@s�ddlmZmZmZeZddlZddlmZ	ddl
mZmZm
Z
mZddlmZddlmZddlmZddlmZe�Zdd
d�Zddd
�Zddd�ZdS)�)�absolute_import�division�print_functionN)�	constants)�AnsibleParserError�AnsibleUndefinedVariable�AnsibleFileNotFound�AnsibleAssertionError)�	to_native)�string_types)�ModuleArgsParser)�DisplayFcCs�ddlm}t|ttd�f�s2td|t|�f��g}	|r�ttt|���}
|
D]�}||}g}
|dur�|�	|�s�|
�
|�|d7}t|
d�z||}Wq^ty�d}Yq^0q^|
|fD](}|r�|	�
|j
||||||||d��q�qN|	S)z�
    Given a list of mixed task/block data (parsed from YAML),
    return a list of Block() objects, where implicit blocks
    are created for each bare Task.
    r��BlockNz%%s should be a list or None but is %s���play�parent_block�role�task_include�use_handlers�variable_manager�loader)�ansible.playbook.blockr�
isinstance�list�typer	�iter�range�lenZis_block�append�next�
IndexError�load)�dsrrrrrrrrZ
block_list�count�iZblock_dsZimplicit_blocks�b�r(�</usr/lib/python3.9/site-packages/ansible/playbook/helpers.py�load_list_of_blocks!s@

��
r*c-Cs
ddlm}ddlm}	ddlm}
ddlm}ddlm	}ddl
m}
ddlm
}dd	lm}t|t�s~td
|t|�f��g}|D�]|}t|t�s�td|t|�f��d|vr�|r�td
|d��|j||||||||d�}|�|�q�t|�}z|jdd�\}}}WnBt�yH}z(|j�r"�tt|�||d��WYd}~n
d}~00|tjv�r�|�rb|
}n|}|j|||d||d�}|j||d�}|||d�}|tjv�r�d}nP|tj v�r�d}n>|d�}t!�"d|d�|�#|j$d��o�|�%��o�|j&}|�r�|j&du�r0|tj v�r$td|d��ntd|d��d|_'|}d}d}d} |�rPd} |du�rxt||��sp|j(}�qPzt)j*�+|�,|j$�-d���}!WnLt.�y�}z2|j'�s�td |j$�-d�|d|d!���WYd}~n
d}~00|du�r�|!}nt)j*�/|��st)j*�0|!|�}|�,|j$d�}"|j1�rDt)j*�0|j1j2| |�}#|�3|#| |"�}$n|�3|�4�||"�}$t)j*�5|$��rnd}�qxn|j(}�qP|�s�z|�,|j$d�}"Wn@t.�y�}z&td"|j$d|d|d!��WYd}~n
d}~00|j1�r�|�3|j1j2| |"�}$n
|�6|"�}$|�7|$�}%|%�st!�8d#|$�q�nt|%t��s4td$|%d��t!�9d%|$�|j:dd&�}&||&_(t;|%|d|&||||d'�}'|&j<dd�}(|'D]})tt=|)j<��>|(��|)_<�q~|�r�|'D]})|�?|)j@��q�n
|�?|'�nd|_A|�|�q�|tjBv�r�|�rtd(|�d)�|d��|j|||d||d�}*d}|tjCv�r*d}|�r�|*j&du�rb|tjCv�rVtd*|d��ntd+|d��d|*_'|j||*d�}|||d�}|*jD|d,�|�,|*jE�|*_E|*jF||d-�\}+},|�?|+�n
|�|*�q�|�r�|	j||||||d�}n|
j||||||d�}|�|�q�|S).zw
    Given a list of task datastructures (parsed from YAML),
    return a list of Task() or TaskInclude() objects.
    rr)�Handler)�Task)�TaskInclude)�IncludeRole)�HandlerTaskInclude)�Templar)�get_versioned_doclinkz)The ds (%s) should be a list but was a %sz)The ds (%s) should be a dict but was a %s�blockz,Using a block as a handler is not supported.)�objrT)Zskip_action_validation)r3�orig_excN)r2rrrr)rZtask)rZ	variablesFz(user_guide/playbooks_reuse_includes.htmlzS"include" is deprecated, use include_tasks/import_tasks instead. See %s for detailsz2.16Z_raw_paramszZYou cannot use loops on 'import_tasks' statements. You should use 'include_tasks' instead.z1You cannot use 'static' on an include with a loopZtasks�handlersz�Error when evaluating variable in dynamic parent include path: %s. When using static imports, the parent dynamic include cannot utilize host facts or variables from inventory)r3Zsuppress_extended_errorr4a'Error when evaluating variable in import path: %s.

When using static imports, ensure that any variables used in their names are defined in vars/vars_files
or extra-vars passed in from the command line. Static imports cannot use variables from facts or inventory
sources like group or host vars.z,file %s is empty and had no tasks to includez0included task files must contain a list of taskszstatically imported: %s)Zexclude_parent)rrrrrrrzUsing 'z ' as a handler is not supported.zXYou cannot use loops on 'import_role' statements. You should use 'include_role' instead.z6You cannot use 'static' on an include_role with a loop)�templar)rr)GrrZansible.playbook.handlerr+Zansible.playbook.taskr,Zansible.playbook.task_includer-Zansible.playbook.role_includer.Z%ansible.playbook.handler_task_includer/Zansible.templater0Zansible.utils.plugin_docsr1rrr	r�dictrr#r r�parser3r
�CZ _ACTION_ALL_INCLUDE_IMPORT_TASKSZget_varsZ_ACTION_INCLUDE_TASKSZ_ACTION_IMPORT_TASKS�displayZ
deprecatedZis_template�argsZall_parents_staticZloopZstatically_loadedZ_parent�os�path�dirname�template�getr�isabs�joinZ_roleZ
_role_pathZpath_dwim_relativeZget_basedir�existsZ	path_dwimZload_from_fileZwarningZvv�copyr*�tags�set�union�extendr2�	is_staticZ'_ACTION_ALL_PROPER_INCLUDE_IMPORT_ROLESZ_ACTION_IMPORT_ROLEZ
post_validateZ
_role_nameZget_block_list)-r$rr2rrrrrrr+r,r-r.r/r0r1Z	task_listZtask_ds�tZargs_parser�actionr;Zdelegate_to�eZ
include_classZall_varsr6rIZinclude_linkZparent_includeZcumulative_path�foundZsubdirZparent_include_dirZinclude_targetZnew_basedirZinclude_file�dataZti_copyZincluded_blocksrEr'ZirZblocks�_r(r(r)�load_list_of_tasksTsZ


�
(�	&

��

��

��rPc
	Cs\ddlm}t|t�s*td|t|�f��g}|D]$}|j||||||d�}	|�|	�q2|S)a�
    Loads and returns a list of RoleInclude objects from the ds list of role definitions
    :param ds: list of roles to load
    :param play: calling Play object
    :param current_role_path: path of the owning role, if any
    :param variable_manager: varmgr to use for templating
    :param loader: loader to use for DS parsing/services
    :param collection_search_list: list of collections to search for unqualified role names
    :return:
    r)�RoleIncludez%ds (%s) should be a list but was a %s)r�current_role_pathrrZcollection_list)Zansible.playbook.role.includerQrrr	rr#r )
r$rrRrrZcollection_search_listrQZrolesZrole_defr&r(r(r)�load_list_of_rolesKs
�rS)NNNFNN)NNNFNN)NNNN)Z
__future__rrrrZ
__metaclass__r<Zansiblerr9Zansible.errorsrrrr	Zansible.module_utils._textr
Zansible.module_utils.sixrZansible.parsing.mod_argsrZansible.utils.displayr
r:r*rPrSr(r(r(r)�<module>s
3
x