%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__/play_context.cpython-39.opt-1.pyc

a

�)g�8�@s�ddlmZmZmZeZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZddlmZddlmZe�Zd	gZd
ZdZGdd	�d	e�Zd
S)�)�absolute_import�division�print_function)�	constants)�context)�paramiko)�FieldAttribute)�Base)�Display)�check_for_controlpersist�PlayContext)
�become�become_user�become_pass�
become_method�become_flags�
connection�docker_extra_args�delegate_toZno_log�remote_user)Zansible_connection�ansible_user�ansible_host�ansible_portZansible_docker_extra_argsZansible_ssh_hostZansible_ssh_passZansible_ssh_portZansible_ssh_userZansible_ssh_private_key_fileZansible_ssh_pipeliningZansible_ssh_executablecs�eZdZdZedejd�Zedd�Zedej	d�Z
edd�Zedd�Zedej
d�Zedd�Zedejd�Zedejd�Zedd�Zedd�Zedd�Zedd�Zedd�Zedd�Zedd�Zedejd�Zedejd�Zedd�Zede d�Z!ede d�Z"edd�Z#eddd�Z$eddd�Z%e&d	d
��Z'e'j(dd
��Z'd�fd
d�	Z)dd�Z*dd�Z+dd�Z,dd�Z-dd�Z.dd�Z/�Z0S)rz�
    This class is used to consolidate the connection information for
    hosts in a play and child tasks, where the task may override some
    connection/authentication information.
    �string)�isa�default)r�int�bool�setFcCstjddd�|jS�NzYPlayContext.verbosity is deprecated, use ansible.utils.display.Display.verbosity instead.gq=
ףp@)�version��displayZ
deprecated�_internal_verbosity��self�r&�A/usr/lib/python3.9/site-packages/ansible/playbook/play_context.py�	verbosityxs
�zPlayContext.verbositycCstjddd�||_dSrr!)r%�valuer&r&r'r(�s
�Ncsvtt|���|duri}|�dd�|_|�dd�|_d|_d|_d|_||_	t
jr^|��nd|_
|rr|�|�dS)NZ	conn_pass�rr)�superr�__init__�get�passwordr�_become_plugin�promptZsuccess_key�connection_lockfdr�CLIARGS�set_attributes_from_clir#�set_attributes_from_play)r%�playZ	passwordsr1��	__class__r&r'r,�s
zPlayContext.__init__cCsHtj�|j|j�}|D],}|r||�d�}|rt|||�|��qdS)N�name)�CZconfigZget_configuration_definitionsZplugin_typeZ
_load_namer-�setattrZ
get_option)r%�plugin�options�option�flagr&r&r'�set_attributes_from_plugin�sz&PlayContext.set_attributes_from_plugincCs|j|_dS�N)�force_handlers)r%r5r&r&r'r4�sz$PlayContext.set_attributes_from_playcCsNtj�dd�rttjd�|_tj�d�|_tj�d�|_tj�dd�|_dS)z�
        Configures this connection information instance with data from
        options specified by the user on the command line. These have a
        lower precedence than those set on the play or host.
        �timeoutF�private_key_filer(�
start_at_taskN)rr2r-rrBrCr#rDr$r&r&r'r3�s
z#PlayContext.set_attributes_from_clicCsx|��}tD]$}t||d�}durt|||�q|jdu�r`|�|j�}|�dt���|t��}tj	}	tj
�d�D]}
|
|vrt||
}	q�qtd|	ftj
�d�D]}||vr�q�q�t�d|�||d<d|	ftj
�d	�D]}||vr��qq�|	d
k�r
d|d<n
tj
|d<d
|	ftj
�d�D] }
|
|v�r*||
�r*�q��q*|j�pX|j|d<n6t�}tj
�d�D]"}||v�rrt|d|�|���qrg}tj
��D]�\}}|D]v}||v�rq�|jdu�rt|t��r$||v�r$t||||�|�|�n$||v�r�t||||�|�|��q��q�tj
�d�D]}||v�r8�qP�q8|jdu�rttj
du�rtttj
�|_t|�dk�rtj
�d�D]}||v�r��q�q�|jtjv}|�d�tjv}|�r�|�r�t|dd�n,t|dd�dk�r|�r�|�st|dtj	�|jdk�r$|j�s$|j|_|jdk�rL|�d�|_t�d|j�|jdu�r`|j|_|jdu�rt|j|_|S)a7
        Sets attributes from the task if they are set, which will override
        those from the play.

        :arg task: the task object with the parameters that were set on it
        :arg variables: variables from inventory
        :arg templar: templar instance if templating variables is needed
        NZansible_delegated_varsrzansible_%s_host�remote_addrzbno remote address found for delegated host %s
using its name, so success depends on DNS resolutionrzansible_%s_port�portZwinrmibrzansible_%s_userrr�
executablerrZinventory_hostname�localz�The "%s" connection plugin has an improperly configured remote target value, forcing "inventory_hostname" templated value instead of the string)�copy�TASK_ATTRIBUTE_OVERRIDES�getattrr:r�templater-�dictr9ZDEFAULT_TRANSPORT�MAGIC_VARIABLE_MAPPINGr"�debugZDEFAULT_REMOTE_PORTr�items�
isinstance�appendrFr�lenrEZ	LOCALHOSTr�connection_userZwarningZ
check_mode�diff)r%Ztask�	variablesZtemplarZnew_info�attrZattr_valZdelegated_host_nameZdelegated_varsZdelegated_transportZ
transport_varZaddress_varZport_varZuser_varZexe_varZattrs_consideredZvariable_namesZ
variable_nameZbecome_pass_nameZconnection_typeZremote_addr_localZinv_hostname_localr&r&r'�set_task_and_variable_override�s�











�z*PlayContext.set_task_and_variable_overridecCs
||_dSr@)r/)r%r;r&r&r'�set_become_pluginKszPlayContext.set_become_pluginc	Csltj��D]\\}}z<d|vr Wq
t||�}|D]}||vr.|dur.|||<q.Wq
tydYq
Yq
0q
dS)z�
        Adds 'magic' variables relating to connections to the variable dictionary provided.
        In case users need to access from the play, this is a legacy from runner.
        r
N)r9rNrPrK�AttributeError)r%rVZpropZvar_listZvar_valZvar_optr&r&r'�update_varsNs
zPlayContext.update_vars)NNN)1�__name__�
__module__�__qualname__�__doc__rr9ZDEFAULT_MODULE_COMPRESSIONZmodule_compression�shellZDEFAULT_EXECUTABLErGrEr.ZDEFAULT_TIMEOUTrBrTZDEFAULT_PRIVATE_KEY_FILErCZANSIBLE_PIPELININGZ
pipeliningZ
network_osrr1r
rrrZDEFAULT_BECOME_EXEZ
become_exeZDEFAULT_BECOME_FLAGSrr0rZ	only_tagsZ	skip_tagsrD�steprA�propertyr(�setterr,r?r4r3rXrYr[�
__classcell__r&r&r6r'rFsJ














N)Z
__future__rrr�typeZ
__metaclass__Zansiblerr9rZ$ansible.module_utils.compat.paramikorZansible.playbook.attributerZansible.playbook.baser	Zansible.utils.displayr
Zansible.utils.ssh_functionsrr"�__all__rJZ
RESET_VARSrr&r&r&r'�<module>s


Zerion Mini Shell 1.0