%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3.9/site-packages/ansible/playbook/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3.9/site-packages/ansible/playbook/__pycache__/playbook_include.cpython-39.pyc

a

�)g��@s�ddlmZmZmZeZddlZddlmZ	ddl
mZmZddl
mZddlmZddlmZmZddlmZmZddlmZdd	lmZdd
lmZddlmZddlm Z dd
l!m"Z"m#Z#ddl$m%Z%ddl&m'Z'e'�Z(Gdd�deee�Z)dS)�)�absolute_import�division�print_functionN)�AnsibleParserError�AnsibleAssertionError)�to_bytes)�string_types)�
split_args�parse_kv)�AnsibleBaseYAMLObject�AnsibleMapping)�NonInheritableFieldAttribute)�Base)�Conditional)�Taggable)�AnsibleCollectionConfig)�_get_collection_name_from_path�_get_collection_playbook_path)�Templar)�DisplaycsXeZdZedd�Zededd�Zeddd��Zd�fd	d
�	Z	�fdd�Z
d
d�Z�ZS)�PlaybookInclude�string)�isa�dict�vars)r�default�aliasNcCst�j||||d�S)N)�ds�basedir�variable_manager�loader)r�	load_data)�datarrr �r#�E/usr/lib/python3.9/site-packages/ansible/playbook/playbook_include.py�load/szPlaybookInclude.loadc
s�ddlm}ddlm}tt|��|||�}|j��}|rF||�	�O}t
||d�}	||d�}
|	�|j�}t
|�}|dur�|d}
|d}n&|}
tj�|
�s�tj�||
�}
t|
�}|r�|t_n$tj�tj�tj�t|
d	d
����|
j|
||j��d�|
jD]�}|j�r$t||��r$|jdd�|_|j|jB}|�dd�}|du�rX|j �!|�"d
��||_t#t$|j ��%|j ��|_ |j&du�r�tj�|
�|_&|jr�|j'|j(|j)|j*D]$}|jdd�|jdd�|_+�q�q�|
S)z�
        Overrides the base load_data(), as we're actually going to return a new
        Playbook() object rather than a PlaybookInclude object
        r)�Playbook)�Play)r Z	variables)r N��Zsurrogate_or_strict)�errors)�	file_namerr�tags�,),Zansible.playbookr&Zansible.playbook.playr'�superrr!r�copyZget_varsr�template�import_playbookr�os�path�isabs�joinrrZdefault_collectionZplaybook_paths�append�dirname�abspathrZ_load_playbook_dataZ_entriesZwhen�
isinstanceZ_included_conditional�popr,�extend�split�list�set�unionZ_included_pathZ	pre_tasksZrolesZtasksZ
post_tasksZ_when)�selfrrrr r&r'Znew_objZall_varsZtemplarZpbr+�resourceZplaybookZplaybook_collection�entryZ	temp_varsZ
param_tagsZ
task_block��	__class__r#r$r!3sH


$

$zPlaybookInclude.load_datacs�t|t�std|t|�f��t�}t|t�r6|j|_|��D]`\}}|tj	vrb|�
||||�q>|dkr�d|vr�td|d��nt|t�s�td|d��|||<q>tt
|��|�S)z�
        Regorganizes the data for a PlaybookInclude datastructure to line
        up with what we expect the proper attributes to be
        z%ds (%s) should be a dict but was a %srzTimport_playbook parameters cannot be mixed with 'vars' entries for import statements��objzEvars for import_playbook statements must be specified as a dictionary)r9rr�typerrZansible_pos�items�CZ_ACTION_IMPORT_PLAYBOOK�_preprocess_importrr.r�preprocess_data)r@r�new_ds�k�vrCr#r$rK~s




zPlaybookInclude.preprocess_datacCsh|durtd|d��nt|t�s4tdt|�|d��t|�}t|�dkrTtd|d��|d��|d<dS)zQ
        Splits the playbook import line up into filename and parameters
        Nz$playbook import parameter is missingrEzQplaybook import parameter must be a string indicating a file path, got %s insteadrz?import_playbook statements must specify the file name to importr1)rr9rrGr	�len�strip)r@rrLrMrNrHr#r#r$rJ�s
z"PlaybookInclude._preprocess_import)NN)NN)
�__name__�
__module__�__qualname__r
r1rZvars_val�staticmethodr%r!rKrJ�
__classcell__r#r#rCr$r*s
Kr)*Z
__future__rrrrGZ
__metaclass__r2Zansible.constantsZ	constantsrIZansible.errorsrrZansible.module_utils._textrZansible.module_utils.sixrZansible.parsing.splitterr	r
Zansible.parsing.yaml.objectsrrZansible.playbook.attributer
Zansible.playbook.baserZansible.playbook.conditionalrZansible.playbook.taggablerZansible.utils.collection_loaderrZ2ansible.utils.collection_loader._collection_finderrrZansible.templaterZansible.utils.displayrZdisplayrr#r#r#r$�<module>s$

Zerion Mini Shell 1.0