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 : |
� ���crB � �2 � d dl mZmZmZ eZd dlmZ d dlZd dl Z d dl Z d dlZd dlZd dl Z d dlZd dlZd dlZd dlmZ d dlmZ d dlmZ d dlmZ d dlmZmZ d d lmZ d d lm Z d dl!m"Z" e"� � Z# G d� d e� � Z$dd�Z%e&dk r e%� � dS dS )� )�absolute_import�division�print_function)�CLIN)� constants)�context)�option_helpers)�AnsibleOptionsError)� to_native�to_text)� module_loader)�run_cmd)�Displayc � � � e Zd ZdZdZdZdZdZddd�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. zansible-pull�gitz local.yml)r � subversion�hg�bzrzFile does not existzFile is not readable)� � �playbook.ymla The 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} t j � dd� � rqt j d D ]^}t |t � � r| dd� |� � z z } �3d|v st j � |� � r| d|z z } �_| 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_cliB s� � ����?���{�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 �� �� t t | � � � dd�� � t j | j � � t j | j � � t j | j � � t j | j � � t j | j � � t j | j � � t j | 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 � dDt j dEddF�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)�destr3 r4 r/ 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)r6 r3 r/ z-fz--force�forcez<run the playbook even if the repository could not be updatedz-dz--directoryr6 zQabsolute 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.)r6 r4 r/ z-Cz --checkout�checkoutzIbranch/tag/commit to checkout. Defaults to behavior of repository module.)r6 r/ z--accept-host-key�accept_host_keyz6adds the hostkey for the repo url if not already added)r3 r6 r4 r/ 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'