403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /lib/python3.11/site-packages/ansible/cli/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib/python3.11/site-packages/ansible/cli/__pycache__/config.cpython-311.opt-1.pyc
�

���c]V���ddlmZmZmZeZddlmZddlZddl	Z	ddl
Z
ddlZddlm
Z
ddlmZddlmcmZddlmZddlmZddlmZmZdd	lmZmZdd
lm Z m!Z!m"Z"ddl#m$Z$ddl%m&Z&dd
l'm(Z(ddl)m*Z*ddl+m,Z,ddl-m.Z.ddl/m0Z0e.��Z1dd�Z2d�Z3d�Z4Gd�de��Z5dd�Z6e7dkre6��dSdS)�)�absolute_import�division�print_function)�CLIN)�Mapping)�context)�	constants)�option_helpers)�
ConfigManager�Setting)�AnsibleError�AnsibleOptionsError)�	to_native�to_text�to_bytes)�	json_dump)�string_types)�	is_quoted)�
AnsibleDumper)�stringc)�Display)�unfrackpathFc�<�tj|t||���S)N)�Dumper�default_flow_style�
default_style)�yaml�dumpr)�datarrs   �7/usr/lib/python3.11/site-packages/ansible/cli/config.py�	yaml_dumpr!&s���9�T�-�DV�fs�t�t�t�t�c�&�t|dd���S)NTz'')rr)r!)rs r �
yaml_shortr$*s���T�d�$�G�G�G�Gr"c��ttd��s(d�tt��D��t_tjS)zE helper method to ensure we can template based on existing constants �cvarsc�d�i|]-}|�d���|tt|����.S)�__)�
startswith�getattr�C)�.0�ks  r �
<dictcomp>z!get_constants.<locals>.<dictcomp>1s4��Z�Z�Z�A�q�|�|�TX�GY�GY�Z�q�'�!�Q�-�-�Z�Z�Zr")�hasattr�
get_constants�dirr+r&�r"r r0r0.s:���=�'�*�*�[�Z�Z��Q���Z�Z�Z�
����r"c���eZdZdZdZd�fd�	Z�fd�Z�fd�Z�fd�Zd�Z	d	�Z
d
�Zdd�Zd�Z
d
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z�xZS)�	ConfigCLIz Config command line class zansible-configNc�v��d|_d|_tt|���||��dS�N)�config_file�config�superr4�__init__)�self�args�callback�	__class__s   �r r:zConfigCLI.__init__:s8���������
�i����'�'��h�7�7�7�7�7r"c���tt|���d���tj�d���}tj|��|�dddd�	��|�d
ddd
ddd
gttj
��zd���|�ddd���|j�d���}d|_
|�dd|g���}|�|j���|�ddddd d!gd!d"�#��|�d$d%|g���}|�|j���|�d&d'd(d)d*�+��|�ddddgd,�d-d.�#��|�d/d0|g���}|�|j���|�d1d2|g���}|�|j���|�ddddgd3�d4d5�#��|�d6d7d)dd8�9��dS):NzView ansible configuration.)�descF)�add_helpz-cz--configr7zGpath to configuration file, defaults to first file found in precedence.)�dest�helpz-tz--type�store�base�type�allz&Filter down to a specific plugin type.)�action�defaultrB�choicesrCr<z<Specific plugin to target, requires type of plugin to be set�*)rC�nargsrH)rBT�listzPrint all config options)rC�parents)�funcz--formatz-f�format�jsonrzOutput format for list)rBrHrJrIrCrzDump configurationz--only-changedz--changed-only�only_changed�
store_truez;Only show configurations that have changed from the default)rBrHrC)rQr�displayrTzOutput format for dump�viewzView configuration file�initzCreate initial configuration)�ini�env�varsrWzOutput format for initz
--disabled�	commentedz=Prefixes all entries with a comment character to disable them)rBrHrIrC)r9r4�init_parser�opt_help�argparse�ArgumentParser�add_verbosity_options�add_argumentrMr+�CONFIGURABLE_PLUGINS�parser�add_subparsers�required�
add_parser�set_defaults�execute_list�execute_dump�execute_view�execute_init)r;�common�
subparsers�list_parser�dump_parser�view_parserr[r>s       �r r[zConfigCLI.init_parser@s���
�i����*�*�.�	+�	
�	
�	
��"�1�1�5�1�A�A���&�v�.�.�.����D�*�=�!j�	�	l�	l�	l����D�(�7�F�QW�bg�io�ap�sw�xy�yO�tP�tP�bP�!I�	�	K�	K�	K����F�)g�or��s�s�s��[�/�/�X�/�>�>�
�"�
�� �+�+�F�9S�^d�]e�+�f�f��� � �d�&7� �8�8�8�� � ��T���[a�ci�Zj�tz�&>�	!�	@�	@�	@�!�+�+�F�9M�X^�W_�+�`�`��� � �d�&7� �8�8�8�� � �!1�3C�.�am�&c�	!�	e�	e�	e�� � ��T���Zu�Zu�Zu�@I�&>�	!�	@�	@�	@�!�+�+�F�9R�]c�\d�+�e�e��� � �d�&7� �8�8�8� �+�+�F�9W�bh�ai�+�j�j��� � �d�&7� �8�8�8�� � ��T���Zp�Zp�Zp�z�&>�	!�	@�	@�	@�� � ��K��^c�&e�	!�	g�	g�	g�	g�	gr"c�z��tt|���|��}|jt_|Sr6)r9r4�post_process_args�	verbosityrT)r;�optionsr>s  �r rqzConfigCLI.post_process_argsks0����	�4�(�(�:�:�7�C�C��#�-����r"c���tt|�����tjdr�ttjdd���|_t|j��}tj	�
|��r9tj|tj��rt|j��|_nFtdt!|j��z���t"j|_|jj|_|jr�	tj	�
|j��std|jz���tj	�|j��std|jz���t!|j��tjd<n�#t*$rNtjdd	vr�tjdd
vr"t,�d|jz��Yn)wxYwtjddkrt1d
���tjd��dS)Nr7F)�followz@The provided configuration file is missing or not accessible: %sz&%s does not exist or is not accessiblez%s is not a valid file�ANSIBLE_CONFIGrH)rU)�edit�updatez(File does not exist, used empty file: %srUz&Invalid or no config file was suppliedrO)r9r4�runr�CLIARGSrr7r�os�path�exists�access�R_OKrr8rrr+�_config_file�isfile�environ�	ExceptionrT�warningr
)r;�b_configr>s  �r ryz
ConfigCLI.runqs���
�i����"�"�$�$�$��?�=�)�		8�*�7�?�=�+I�RW�X�X�X�D���� 0�1�1�H��w�~�~�h�'�'�
L�B�I�h���,H�,H�
L�+�D�,<�=�=����)�*l�ox�y}�zJ�pK�pK�+K�L�L�L��(�D�K�#�{�7�D����	I�
c��w�~�~�d�&6�7�7�]�-�.V�Z^�Zj�.k�l�l�l������(8�9�9�]�-�.F�$�JZ�.[�\�\�\�/8��9I�/J�/J��
�+�,�,���
c�
c�
c��?�8�,��8�8���_�X�.�2D�D�D��O�O�$N�QU�Qa�$a�b�b�b���	
c�����_�X�
&�&�
0�
0��G�H�H�H�	����!�!�!�!�!s�BF3�3AH�
Hc� �td���)zG
        Updates a single setting in the specified ansible.cfg
        �Option not implemented yet)r
rrzr�split�
subprocess�callr7)r;�entry�value�section�options     r �execute_updatezConfigCLI.execute_update�����7�8�8�8r"c�2�	t|jd��5}|�t|���d�����ddd��dS#1swxYwYdS#t
$r$}t
dt|��z���d}~wwxYw)z2
        Displays the current config file
        �rb�surrogate_or_strict��errorsNzFailed to open config file: %s)�openr7�pagerr�readr�r
r)r;�f�es   r rizConfigCLI.execute_view�s���	P��d�&��-�-�
L���
�
�7�1�6�6�8�8�4I�J�J�J�K�K�K�
L�
L�
L�
L�
L�
L�
L�
L�
L�
L�
L�
L����
L�
L�
L�
L�
L�
L���	P�	P�	P��?�)�A�,�,�N�O�O�O�����	P���s:�A(�7A�A(�A�A(�"A�#A(�(
B�2B�Bc� �td���)z9
        Opens ansible.cfg in the default EDITOR
        r�)r
�shlexr�r{r��get�appendr7r�r�r�r)r;�editorr�s   r �execute_editzConfigCLI.execute_edit�r�r"c��i}ttd|z��}|rTg}|D]N}|�|d���}|�t�d|z���9|�|���On|�d���}|D]}}|jx}}	|	�d��r?tj
�|j��r�E|	�
ddd��dz}|j�||	��||<�~|S)	N�	%s_loaderT��
class_only�0Skipping %s as we could not find matching plugin�_���
 (DEPRECATED))r*�
plugin_loaderr�rTr�r�rG�
_load_namer)r{r|�islink�_original_path�replacer8�get_configuration_definitions)
r;�ptype�plugins�entries�loader�	plugin_cs�plugin�p�	finalname�names
          r �_list_plugin_settingszConfigCLI._list_plugin_settings�s1�������e�(;�<�<���		4��I�!�
(�
(���J�J�v�$�J�7�7���9��O�O�$V�Y_�$_�`�`�`�`��$�$�Q�'�'�'�'�
(��
�
�d�
�3�3�I� �		X�		X�F�%�0�0�I�����s�#�#�
K��7�>�>�&�"7�8�8�K�� $���S�"�a� 8� 8�?� J�I�!%��!J�!J�5�RV�!W�!W�G�I����r"c��i}tjddvr|j�d���}tjddkri|d<tjddkr@tjD]2}|�|��|d|���<�3netjddkrO|�tjdtjd��|dtjd<|S)	z>
        build a dict with the list requested configs
        rF)rErGT��ignore_privaterE�PLUGINSrGr<)rrzr8r�r+rar��upper)r;�config_entriesr�s   r �_list_entries_from_argsz!ConfigCLI._list_entries_from_args�s�����?�6�"�o�5�5�!�[�F�F�VZ�F�[�[�N��?�6�"�f�,�,�(*�N�9�%��?�6�"�e�+�+��/�
]�
]��;?�;U�;U�V[�;\�;\��y�)�%�+�+�-�-�8�8�
]�
�_�V�
$��
.�
.�AE�A[�A[�\c�\k�lr�\s�u|�vE�FL�vM�BN�BN�N�9�%�g�o�f�&=�>��r"c��|���}tjddkrt|��}n%tjddkrt	|��}|�t
|d�����dS)z3
        list and output available configs
        rPrrQr�r�N)r�rrzr!rr�r)r;r��outputs   r rgzConfigCLI.execute_list�s{��
�5�5�7�7���?�8�$��.�.��~�.�.�F�F�
�_�X�
&�&�
0�
0��~�.�.�F��
�
�7�6�*?�@�@�@�A�A�A�A�Ar"c�F�g}tjdrd}nd}|D�]�}||�d��s�||�dd��}|dkr�||�dd��}|dkr|rd	}n�d
}n�|r�|dkrUt|t��s@	d�|��}n)#t$r}d
t|��z}Yd}~nd}~wwxYwt|t��r#t|��stj
|��}n|�d}|||v�rs|||�rd|||dd}	t||dt��r||d}
n!d�||d��}
||�d|��}|�d|�d||�dd���d|
����|dkr4|	�d��r���|�|�|	�d|����nV|dkrP|	�d��r��5|�||	�dtt|��d�����z��|�d�����|S)NrZ�#r��descriptionrIrXrF�boolean�1�0rM�, z%s���r�z
#z# �(�stringz): �	_ANSIBLE_�=rY�	_ansible_z: r�r�)rrzr��
isinstancer�joinr�rrr��quoter�r)rr$)r;�settings�subkeyr�prefix�settingrI�styper�r�r@r�s            r �_get_settings_varszConfigCLI._get_settings_varss������?�;�'�	��F�F��F��-	 �-	 �G��G�$�(�(��7�7�
���w�'�+�+�I�r�:�:�G����� ��)�-�-�f�b�9�9���I�%�%��&�"%���"%����!�����)�'�<�@�@�D�D�*.�)�)�G�*<�*<����#,�D�D�D�*.��7�1C�1C�*C�����������D����"�'�<�8�8�7��7�AS�AS�7�"'�+�g�"6�"6����_� �G���'�*�*�*�x��/@��/H�*� ��)�&�1�"�5�f�=���h�w�/�
�>��M�M�H�#�G�,�]�;�D�D� �:�:�h�w�&7�
�&F�G�G�D���(�,�,�V�W�=�=������d�d�d�H�W�4E�4I�4I�&�RZ�4[�4[�4[�4[�]a�]a�b�c�c�c��U�?�?��'�'��4�4�!� ��K�K�V�V�U�U�U�G�G� D�E�E�E�E��v�%�%��'�'��4�4�!� ��K�K��U�U�U�G�J�w�DW�DW�`u�<v�<v�<v�<v�)w� w�x�x�x����B������s�%B;�;
C!�C�C!c��i}t|�����D�]�}||}t|t��s�!|�d��sL|�|��}|D]3}||vr"||�||���(||||<�4��t|dt��r#d|�dd���d|d��}n7d|�dd��z}|d�|d��z
}d|vr�|dr�|dd	}|d
|vrg||d
<|�dd��}	|�dd��d
kr+t|	t��sd�|	��}	n|	�d}	tj
drd|dz|d<|d|d�d|	��z}
||d
�|
�����|S)Nr�z# (rFr�z) z# (%s) z
# rWr�r�rIr�rMr�rZz;%s�key�
r�)�sorted�keysr�rr��_get_settings_ini�extendrr�rrzr�)r;r��sections�o�opt�new_sections�sr@r�rIr�s           r r�zConfigCLI._get_settings_ini=s ������
�
���(�(�(	7�(	7�A��1�+�C��c�7�+�+�
���7�7�=�)�)�
�#�5�5�c�:�:��%�6�6�A��H�}�}� ���*�*�<��?�;�;�;�;�&2�1�o�������#�m�,�l�;�;�
8�
8�&)�g�g�f�h�&?�&?�&?�&?��]�AS�AS�T��� �3�7�7�6�8�#<�#<�<������C�
�$6�7�7�7����|�|��E�
�|��E�
�2�����#�8�3�3�13�H�U�9�-�.��'�'�)�R�0�0���7�7�6�2�&�&�&�0�0��G�\�9Z�9Z�0�"�i�i��0�0�G�G��_� �G��?�;�/�8�#(�5��<�#7�E�%�L��d�%��,�,�,���@�@����y�)�*�1�1�#�6�6�6���r"c	��g}|���}|�dd��}tjddkr�|�|��}|rV|D]S}|�||��}|D]3}||vr"||�||���(||||<�4�T|ry|���D]d}|�d|z��||D],}	|�|	��|�d���-|�d���en�tjddvr�|�|tjd��}|rg|D]d}||���D]G}
|�|�|||
tjd�����H�e|�	td�|��d�	����dS)
Nr�rPrWz[%s]r�)rXrYr�r�r�)r��poprrzr�r�r�r�r�r�rr�)r;rr��plugin_typesr�r��plugin_sectionsr�r�r�r�s           r rjzConfigCLI.execute_initls+�����5�5�7�7��%�)�)�)�T�:�:���?�8�$��-�-��-�-�n�=�=�H��
=�)�=�=�E�&*�&<�&<�\�%�=P�&Q�&Q�O�,�=�=����=�=�$�Q�K�.�.��q�/A�B�B�B�B�*9�!�*<�H�Q�K�K�	=��
$�'�}�}���$�$�G��K�K��� 0�1�1�1�'��0�(�(�����C�(�(�(����B������K�K��O�O�O�O��
�_�X�
&�/�
9�
9��*�*�>�7�?�8�;T�U�U�D��
u�)�u�u�E�".�u�"5�":�":�"<�"<�u�u�����D�$;�$;�L��<O�PV�<W�Y`�Yh�iq�Yr�$s�$s�t�t�t�t�u�	
�
�
�7�4�9�9�T�?�?�3H�I�I�I�J�J�J�J�Jr"c�\�g}t|��D�]}||jdv}tjddkr�t	||t
��rK||jdkrd}n||jdkrd}nd}|�d	||j�d
||j��}n%d}|�d	d�d
||�d����}t||��}n+i}||j	D]}t|||��||<�tjdr|r|�|����|S)N)rI�REQUIREDrPrTrI�greenr��red�yellowr�z) = rR)r��originrrzr�rr�r�r�_fieldsr*r�)	r;r8r�r��changed�color�msgr�r�s	         r �_render_settingszConfigCLI._render_settings�sZ�����f�~�~�	&�	&�G��g��-�5L�L�G���x�(�I�5�5��f�W�o�w�7�7�_��g��-��:�:� '������/�:�=�=� %��� (��+2�7�7�F�7�O�4J�4J�4J�F�SZ�O�La�La�b�C�C�#�E�+2�7�7�I�I�I�v�g��?R�?R�S\�?]�?]�?]�^�C���U�+�+�����!�'�?�2�?�?�C�!(����#�!>�!>�E�#�J�J��?�>�2�
&�g�
&����u�%�%�%���r"c�J�|j�d������}|���D]M}tj�||jt�����\}}t|||d��||<�N|�	|��S)NTr�)�cfile�	variables)
r8r��copyr�r+�get_config_value_and_originr7r0rr�)r;r8r��vr�s     r �_get_global_configszConfigCLI._get_global_configs�s�����:�:�$�:�O�O�T�T�V�V���{�{�}�}�	;�	;�G��8�7�7��t�GW�cp�cr�cr�7�s�s�D�A�q�%�g�q�!�T�:�:�F�7�O�O��$�$�V�,�,�,r"c��ttd|z��}g}i}|rig}|D]c}|�|d���}|�t�d|z���9|�|�|d������dn|�d���}|D�]"}|jx}	}
|
�d��r?tj
�|j��r�F|
�
ddd��dz}	|j�||
��||	<	|�|
d���}nG#t $r:}t�d	|
�d
|�dt#|������Yd}~��d}~wwxYw||	���D]�}
	t&j�|
|j||
t-�����\}}n@#t.$r3}t1|���d
��rd}d}n|�Yd}~nd}~wwxYw|�|�d}t3|
||d��||	|
<��|�||	��}|rot6jddkrB|�d|	�ddt;|	��z����|�|����|�|	|i����$|S)Nr�Tr�r�r�r�r�r�z
Skipping "z" z; plugin, as we cannot load plugin to check config due to : )r��plugin_type�plugin_namer�z2No setting was provided for required configurationr�rPrTr��:
)r*r�r�rTr�r�rGr�r)r{r|r�r�r�r8r�r�rr�r+r�r7r0r
rrr�rrz�lenr�)r;r�r�r�r�r�r�r�r�r�r�rr�r�r�r��resultss                 r �_get_plugin_configszConfigCLI._get_plugin_configs�sk�����e�(;�<�<�������		4��I�!�
J�
J���J�J�v�$�J�7�7���9��O�O�$V�Y_�$_�`�`�`�`��$�$�V�Z�Z��4�Z�%H�%H�I�I�I�I�
J��
�
�d�
�3�3�I��-	8�-	8�F�%�0�0�I�����s�#�#�
G��7�>�>�&�"7�8�8��� �L�L��b�!�4�4��F�	�)-��(Q�(Q�RW�Y]�(^�(^�N�9�%�
��z�z�$�4�z�8�8�����
�
�
�����sw�sw�sw�y~�y~�y~�AJ�KL�AM�AM�AM�!N�O�O�O����������
����
*�)�4�9�9�;�;�
R�
R�� ��8�?�?��t�O_�mr�AE�Q^�Q`�Q`�?�a�a�D�A�q�q��#� � � ��q�z�z�,�,�-a�b�b� � ��&�������������� �����9���"�A�5<�W�a��D�5Q�5Q��y�)�'�2�2��+�+�N�9�,E�F�F�G��
8��?�8�,�	�9�9��M�M�M����C�#�i�.�.�<P�<P�"Q�R�R�R��M�M�'�*�*�*�*��M�M�9�g�"6�7�7�7���
s0�D7�7
E;�0E6�6E;�8G�
H�)H�Hc
�H�tjddkr|���}�n[tjddk�r|���}tjD]�}|�|tjd��}tjddkrgtjdr|rR|�d|����d	d
t|��z����|�	|����|dvr|���}nd|���z}|�||i����n6|�tjdtjd��}tjddkrd�
|��}tjdd
krt|��}n%tjddkrt|��}|�
t|d�����dS)zM
        Shows the current settings, merges ansible.cfg if specified
        rFrErGr<rPrTrRr�r�r�)�modules�
doc_fragmentsz
%s_PLUGINSrrQr�r�N)rrzr�r+rarr�r�r�r�r�r!rr�r)r;r�r��plugin_list�pname�texts      r rhzConfigCLI.execute_dump�s����?�6�"�f�,�,��-�-�/�/�F�F�
�_�V�
$��
-�
-��-�-�/�/�F��/�
8�
8��"�6�6�u�g�o�f�>U�V�V���?�8�,�	�9�9�"�?�>�:�3�k�3��
�
�
�U�[�[�]�]�]�]�C�#�e�*�*�DT�DT�&U�V�V�V��
�
�k�2�2�2��� <�<�<� %���
�
��� ,�u�{�{�}�}� <���M�M�5�+�"6�7�7�7�7�
8��-�-�g�o�f�.E�w��W]�G^�_�_�F��?�8�$�	�1�1��9�9�V�$�$�D��?�8�$��.�.��V�$�$�D�D�
�_�X�
&�&�
0�
0��V�$�$�D��
�
�7�4�(=�>�>�>�?�?�?�?�?r"r6)�__name__�
__module__�__qualname__�__doc__r�r:r[rqryr�rir�r�r�rgr�r�rjr�r�rrh�
__classcell__)r>s@r r4r45s}�������%�%��D�8�8�8�8�8�8�%g�%g�%g�%g�%g�V�����!"�!"�!"�!"�!"�F���0P�P�P�K�K�K�����<���*B�B�B�7�7�7�r-�-�-�^!K�!K�!K�F���@-�-�-�D�D�D�L"@�"@�"@�"@�"@�"@�"@r"r4c�:�t�|��dSr6)r4�cli_executor)r<s r �mainr"s��
���4� � � � � r"�__main__)FNr6)8�
__future__rrrrF�
__metaclass__�ansible.clirr{rr�r��collections.abcr�ansibler�ansible.plugins.loaderr�r�r�r	r+�ansible.cli.argumentsr
r\�ansible.config.managerrr�ansible.errorsr
r�ansible.module_utils._textrrr� ansible.module_utils.common.jsonr�ansible.module_utils.sixr�ansible.parsing.quotingr�ansible.parsing.yaml.dumperr�ansible.utils.colorr�ansible.utils.displayr�ansible.utils.pathrrTr!r$r0r4rrr2r"r �<module>r"sL��C�B�B�B�B�B�B�B�B�B��
�������	�	�	�	�������������#�#�#�#�#�#�������.�.�.�.�.�.�.�.�.�"�"�"�"�"�"�<�<�<�<�<�<�9�9�9�9�9�9�9�9�<�<�<�<�<�<�<�<�C�C�C�C�C�C�C�C�C�C�6�6�6�6�6�6�1�1�1�1�1�1�-�-�-�-�-�-�5�5�5�5�5�5�'�'�'�'�'�'�)�)�)�)�)�)�*�*�*�*�*�*�
�'�)�)��u�u�u�u�H�H�H����j@�j@�j@�j@�j@��j@�j@�j@�Z!�!�!�!��z����D�F�F�F�F�F��r"

Youez - 2016 - github.com/yon3zu
LinuXploit