Anons79 Mini Shell

Directory : /proc/self/root/lib/python2.7/site-packages/ansible/cli/
Upload File :
Current File : //proc/self/root/lib/python2.7/site-packages/ansible/cli/pull.pyc

�
�Udac@`sKddlmZmZmZeZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlmZddlmZddlmZddlmZddlmZddlmZmZdd	lmZdd
lmZddl m!Z!ddl"m#Z#e#�Z$d
efd��YZ%dS(i(tabsolute_importtdivisiontprint_functionN(t	constants(tcontext(tCLI(toption_helpers(tAnsibleOptionsError(t	to_nativetto_text(tshlex_quote(t
module_loader(trun_cmd(tDisplaytPullCLIcB`s�eZdZdZdZdZidd6dd	6ZdgZid
d6Ze	Z
ed��Zd
�Z
d�Zd�Zed��Zed��ZRS(s� is used to up 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.

        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.
    tgits	local.ymlt
subversionthgtbzrsFile does not existisFile is not readableisThe 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*.splaybook.ymlcC`s�d}tjjdt�r�xptjdD]^}t|t�rX|ddj|�7}q)d|ksvtjj	|�r)|d|7}q)q)Wn|S(Ntt	inventorys	 -i '%s' t,s -i %s (
RtCLIARGStgettFalset
isinstancetlisttjointostpathtexists(tinv_optstinv((s4/usr/lib/python2.7/site-packages/ansible/cli/pull.pyt_get_inv_cli:scC`stt|�jdddd�tj|j�tj|j�tj|j�tj|j�tj	|j�tj
|j�tj|j�|jjddddd	d
d�|jjdd
t
dddd�|jjddddd
t
dddd�|jjddddd
dBdd�|jjddddd
t
dddd�|jjddddd
dBdd �|jjd!d"dd#d
dBdd$�|jjd%dd&dddd'�|jjd(d)dd*dd+�|jjd,d
t
dd-dddd.�|jjd/d0dd1d
|jdd2|j|jf�|jjd3dd4d
t
dddd5�|jjd6dd7d
t
dddd8�|jjd9dd:d
t
dddd;�|jjd<d
t
dd=dddd>�|jjd?d
tjdd@ddddA�dBS(Cs* create an options parser for bin/ansible tusages0%prog -U <repository> [options] [<playbook.yml>]tdescsDpulls playbooks from a VCS repo and executes them for the local hosttargsthelpsPlaybook(s)tmetavarsplaybook.ymltnargst*s--purgetdefaulttactiont
store_trues!purge checkout after playbook runs-os--only-if-changedtdestt	ifchangeds8only run the playbook if the repository has been updateds-ss--sleeptsleeps|sleep for random interval (between 0 and n number of seconds) before starting. This is a useful way to disperse git requestss-fs--forcetforces<run the playbook even if the repository could not be updateds-ds--directorys#directory to checkout repository tos-Us--urlturlsURL of the playbook repositorys--fullt	fullclones*Do a full clone, instead of a shallow one.s-Cs
--checkouttcheckoutsIbranch/tag/commit to checkout. Defaults to behavior of repository module.s--accept-host-keytaccept_host_keys6adds the hostkey for the repo url if not already addeds-ms
--module-nametmodule_namesdRepository module name, which ansible will use to check out the repo. Choices are %s. Default is %s.s--verify-committverifys�verify GPG signature of checked out commit, if it fails abort running the playbook. This needs the corresponding VCS module to support such an operations--cleantcleans:modified files in the working repository will be discardeds--track-subst	tracksubsstsubmodules will track the latest changes. This is equivalent to specifying the --remote flag to git submodule updates--checktchecksRdon't make any changes; instead, try to predict some of the changes that may occurs--difftdiffshwhen changing (small) files and templates, show the differences in those files; works great with --checkN(tsuperRtinit_parsertopt_helptadd_connect_optionstparsertadd_vault_optionstadd_runtask_optionstadd_subset_optionstadd_inventory_optionstadd_module_optionstadd_runas_prompt_optionstadd_argumentRtNonetDEFAULT_REPO_TYPEtREPO_CHOICEStCtDIFF_ALWAYS(tself((s4/usr/lib/python2.7/site-packages/ansible/cli/pull.pyR;FsL""$$%%"!!!!!!$cC`swtt|�j|�}|jsHtj�}tjjd|�|_ntjj	tjj
|j��|_tjj|j�r�tjj|j�r�t
d|j��n|jry(tjdt|j��}||_Wqtk
rt
d|j��qXn|js t
d��n|j|jkrZt
d|jdj|j�f��n|jt_|j|�|S(Ns~/.ansible/pulls*%s is not a valid or accessible directory.is%s is not a number.s1URL for repository not specified, use -h for helps*Unsupported repo module %s, choices are %sR(R:Rtpost_process_argsR,tsockettgetfqdnRRRt
expandvarst
expanduserRtisdirRR.trandomtrandinttintt
ValueErrorR0R4tSUPPORTED_REPO_MODULESt	verbositytdisplaytvalidate_conflicts(RKtoptionsthostnametsecs((s4/usr/lib/python2.7/site-packages/ansible/cli/pull.pyRLys(	$+	

	(
cC`s�tt|�j�tjj�}tj|jd��tjdjtj	��t
j�}tj
�}ddjt|||jd�d|jd�dg��}d}tjddkr�|d	d
jgtdtjd�D]}d^q��7}n|j�}|s4d}|d
tdtj�7}ntjddkrdtjdtjdf}tjdr�|dtjd7}ntjdr�|d7}ntjdr�|dtjd7}ntjdr�|d7}ntjdr�|d7}ntjdsh|d7}qhnNtjdd kr�d!tjdtjdf}tjdrp|d"tjd7}ntjdsh|d#7}qhn�tjdd$kr�d!tjdtjdf}tjdrh|d"tjd7}qhn�tjdd%kr?dtjdtjdf}tjdrh|dtjd7}qhn)td&tjddj|j�f��tjd'r�|d(7}ntjtjd�}	|	dNkr�td)tjd��ntjjtjjtj	d��}
d*|
||tjd||f}x)tjd+D]}|d,t|�7}qWtjd-rntjd.tjd-�tj tjd-�ntj!d/�tj"d0|�t#|d1t$�\}
}}|
dkr�tjd2r�tj%d3�q|
Sn*tjd4rd5|krtjd6�dS|j&tjd�}|dNkr2td7��nd8|
||f}tjd9r{x&tjd9D]}|d:|7}q`Wntjd;r�x&tjd;D]}|d<|7}q�Wnx)tjd+D]}|d,t|�7}q�Wtjd=r�|d>7}ntjd?r+|d@t'dAjtjd?��7}ntjdBr_|dCt'dAjtjdB��7}ntjdDr�|dEtjdD7}n|dE|7}tjdFr�|dG7}ntjdHr�|dI7}ntj(tjd�|j�}|r�||7}ntj!dJ�tj!d0|�t#|d1t$�\}
}}tjdKr�tj(dL�yt)j*tjd�Wq�t+k
r�}tj,dMtjdt-|�f�q�Xn|
S(Os! use Runner lib to do SSH things sStarting Ansible Pull at %F %Tt slocalhost,%s,127.0.0.1Rt.is	-c local RWs -%sRtvs -i localhost, s-e %s sansible_python_interpreter=%sR4Rsname=%s dest=%sR0R,R2s version=%sR3s accept_hostkey=yestprivate_key_files key_file=%sR5s verify_commit=yesR7s track_submodules=yesR1s depth=1Rsrepo=%s dest=%ss revision=%ss export=yesRRs5Unsupported (%s) SCM module for pull, choices are: %sR6s
 force=yessmodule '%s' not found.
s*%s/ansible %s %s -m %s -a "%s" all -l "%s"t
extra_varss -e %sR.sSleeping for %d seconds...s0running ansible with VCS module to checkout reposEXEC: %stliveR/sFUnable to update repository. Continuing with (forced) run of playbook.R-s"changed": trues%Repository has not changed, quitting.s!Could not find a playbook to run.s%s/ansible-playbook %s %stvault_password_filess --vault-password-file=%st	vault_idss --vault-id=%stbecome_ask_passs --ask-become-passt	skip_tagss --skip-tags "%s"u,ttagss -t "%s"tsubsets -l "%s"R8s -CR9s -Ds*running ansible-playbook to do actual worktpurget/uFailed to remove %s: %sN(.R:RtruntdatetimetnowRXtstrftimeRtsystargvtplatformtnodeRMRNtsettsplitRRtrangeR!R
t
executableRRHRtfind_pluginRFRRtdirnametabspathttimeR.tdebugtvvvvRtTruetwarningtselect_playbookRtchdirtshutiltrmtreet	ExceptionterrorR	(RKRmRrthostt
limit_optst	base_optstxRt	repo_optsRtbin_pathtcmdtevtrctb_outtb_errtplaybooktvault_password_filetvault_idte((s4/usr/lib/python2.7/site-packages/ansible/cli/pull.pyRk�s�?=















%










'
'








+cC`s3tjj|�sdStj|tj�s/dSdS(Niii(RRRtaccesstR_OK(R((s4/usr/lib/python2.7/site-packages/ansible/cli/pull.pyttry_playbook/s
c	C`s~d}tjdr�tjdddk	r�tjj|tjdd�}tj|�}|dkr�tj	d|tj
|f�dS|Stj�}tjj||d�}tjj||j
d�dd�}tjj|tj�}g}xZ|||gD]I}tj|�}|dkr/|}Pq|jd|tj
|f�qW|dkrvtj	dj|��n|SdS(NR$is%s: %ss.ymlR^s
(RFRRRRRRR�RXR~tPLAYBOOK_ERRORSRMRNRttDEFAULT_PLAYBOOKtappend(	RR�R�tfqdnthostpbtshorthostpbtlocalpbterrorstpb((s4/usr/lib/python2.7/site-packages/ansible/cli/pull.pyR7s,$ &"(sgits
subversionshgsbzr(t__name__t
__module__t__doc__RGR�RHR�RVt	ARGUMENTSR}tSKIP_INVENTORY_DEFAULTStstaticmethodR!R;RLRkR�R(((s4/usr/lib/python2.7/site-packages/ansible/cli/pull.pyRs 

	
	3		�(&t
__future__RRRttypet
__metaclass__RlRRqRRR�RMRoRztansibleRRIRtansible.cliRtansible.cli.argumentsRR<tansible.errorsRtansible.module_utils._textRR	tansible.module_utils.six.movesR
tansible.plugins.loaderRtansible.utils.cmd_functionsRtansible.utils.displayR
RXR(((s4/usr/lib/python2.7/site-packages/ansible/cli/pull.pyt<module>s*	

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]