??????????????
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 173

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 174

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 175

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 176

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 177

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 178
ó àUdac@`s*ddlmZmZmZeZdZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlmZddljZddlmZddlmZmZddlmZddlmZmZmZdd lmZm Z dd l!m"Z"e"ƒZ#d efd „ƒYZ$dS( i(tabsolute_importtdivisiontprint_functions- author: - Lorin Hochestein - Leendert Brouwer connection: docker short_description: Run tasks in docker containers description: - Run commands or put/fetch files to an existing docker container. version_added: "2.0" options: remote_user: description: - The user to execute as inside the container vars: - name: ansible_user - name: ansible_docker_user docker_extra_args: description: - Extra arguments to pass to the docker command line default: '' remote_addr: description: - The name of the container you want to access. default: inventory_hostname vars: - name: ansible_host - name: ansible_docker_host N(t LooseVersion(t selectors(t AnsibleErrortAnsibleFileNotFound(t shlex_quote(tto_bytest to_nativetto_text(tConnectionBasetBUFSIZE(tDisplayt ConnectioncB`sžeZdZdZeZd„Zed„ƒZd„Z d„Z d„Z d„Z d„Z dd „Zded „Zd „Zd „Zd „Zd„ZRS(s Local docker based connections tdockercO`s¾tt|ƒj||||Žt|jdtƒr@d|_nd|kr\|d|_n-tj j dƒ|_|js‰t dƒ‚n|j ƒ}|dkr±t jd ƒn|dkrät|ƒtd ƒkrät d ƒ‚nd|_d|_|jjdk r–|dks,t|ƒtd ƒkrJ|jj|_|j|_qº|jƒ|_|j|jjkrºt jd j||jp‰dƒƒqºn$|jjdkrº|jƒ|_ndS(Nt _IS_WINDOWSs.ps1s.exettdocker_commandRs docker command not found in PATHudevu;Docker version number is "dev". Will assume latest version.u1.3s4docker connection type requires docker 1.3 or higheru1.7uEdocker {0} does not support remote_user, using container default: {1}u?i(s.ps1s.exeR(tsuperRt__init__tgetattrt_shelltFalset!module_implementation_preferencest docker_cmdt distutilstspawntfind_executableRt_get_docker_versiontdisplaytwarningRtNonet remote_usert actual_usert _play_contextt_get_docker_remote_usertformatt_displayt verbosity(tselft play_contextt new_stdintargstkwargstdocker_version((sE/usr/lib/python2.7/site-packages/ansible/plugins/connection/docker.pyRCs2      $  $ cC`stjdd|ƒS(Nu [^0-9a-zA-Z.]u(tretsub(tversion((sE/usr/lib/python2.7/site-packages/ansible/plugins/connection/docker.pyt_sanitize_versionvscC`s—g}|jjr.||jjjdƒ7}ndg}|jg||}tj|dtjdtjƒ}|jƒ\}}|t|ƒ||j fS(Nt R0tstdouttstderr( R#tdocker_extra_argstsplitRt subprocesstPopentPIPEt communicateR t returncode(R(tcmd_argstold_version_subcommandtold_docker_cmdtpt cmd_outputterr((sE/usr/lib/python2.7/site-packages/ansible/plugins/connection/docker.pyt_old_docker_versionzs  !cC`sg}|jjr.||jjjdƒ7}ndddg}|jg||}tj|dtjdtjƒ}|jƒ\}}|t|ƒ||j fS(NR2R0s--formats'{{.Server.Version}}'R3R4( R#R5R6RR7R8R9R:R R;(R(R<tnew_version_subcommandtnew_docker_cmdR?R@RA((sE/usr/lib/python2.7/site-packages/ansible/plugins/connection/docker.pyt_new_docker_version‡s !cC`sÏ|jƒ\}}}}|dkrsxLt|ddƒjdƒD],}|jdƒr@|j|jƒdƒSq@Wn|jƒ\}}}}|r¶tdt|ƒt|ƒfƒ‚n|jt|ddƒƒS(Niterrorstsurrogate_or_strictu uServer version:is$Docker version check (%s) failed: %s(RBR R6t startswithR1RERR (R(tcmdR@RAR;tline((sE/usr/lib/python2.7/site-packages/ansible/plugins/connection/docker.pyR”s "%cC`stj|jddd|jjgdtjdtjƒ}|jƒ\}}t|ddƒ}|jdkrt j d |t|ƒfƒd S|j ƒpœd S( s9 Get the default user configured in the docker container tinspects--formats{{.Config.User}}R3R4RFRGiu<unable to retrieve default user from docker container: %s %surootN( R7R8RR#t remote_addrR9R:R R;RRR tstrip(R(R?toutRA((sE/usr/lib/python2.7/site-packages/ansible/plugins/connection/docker.pyR$¢s$cC`s„|jg}|jjr4||jjjdƒ7}n|dg7}|jdk rf|d|jg7}n|d|jjg|7}|S(sÕ Build the local docker exec command to run cmd on remote_host If remote_user is available and is supported by the docker version we are using, it will be provided to docker exec. R2texecs-us-iN(RR#R5R6R!R RL(R(RIt local_cmd((sE/usr/lib/python2.7/site-packages/ansible/plugins/connection/docker.pyt_build_exec_cmd±s   cC`sWtt|ƒjƒ|jsStjdj|jp4dƒd|jj ƒt |_ndS(s) Connect to the container. Nothing to do u)ESTABLISH DOCKER CONNECTION FOR USER: {0}u?thostN( RRt_connectt _connectedRtvvvR%R"R#RLtTrue(R(tport((sE/usr/lib/python2.7/site-packages/ansible/plugins/connection/docker.pyRSÇs   cC`sµtt|ƒj|d|d|ƒ|j|jjd|gƒ}tjdjt |ƒƒd|jj ƒtj dƒg|D]}t |ddƒ^q|}t j|d t jd t jd t jƒ}tj d ƒ|jri|jjƒri|ritj|jtjtj|jtjƒtjBƒtj|jtjtj|jtjƒtjBƒtjƒ}|j|jtjƒ|j|jtjƒd }zx |jj|ƒ r |jj|ƒ r |j|jj ƒ} | s|j!ƒ\} } t"dt#|ƒƒ‚nx\| D]T\} } | j$|jkr:|jj%ƒ}q | j$|jkr |jj%ƒ}q q W|s“|j!ƒ\} } t"dt#|ƒƒ‚n||7}q—WWd|j&ƒX|jj|ƒs|jj'dd|jƒ}|j(j)t |ddƒdƒntj|jtjtj|jtjƒtj@ƒtj|jtjtj|jtjƒtj@ƒntj dƒ|j!|ƒ\} } tj dƒtj dƒ|j*| | fS(s" Run a command on the docker host tin_datatsudoables-cuEXEC {0}RRsopening command with Popen()RFRGtstdinR3R4s!done running command with Popen()Rs:timeout waiting for privilege escalation password prompt: s;privilege output closed while waiting for password prompt: Nt become_passt playcontexts s!getting output with communicate()sdone communicatingsdone with docker.exec_command()(+RRt exec_commandRQR#t executableRRUR%R RLtdebugRR7R8R9tbecomet expect_prompttfcntlR3tF_SETFLtF_GETFLtost O_NONBLOCKR4RtDefaultSelectortregistert EVENT_READt check_successtcheck_password_prompttselectttimeoutR:RR tfileobjtreadtcloset get_optionRZtwriteR;(R(RIRXRYRPtiR?tselectort become_outputteventsR3R4tkeyteventtchunkR[((sE/usr/lib/python2.7/site-packages/ansible/plugins/connection/docker.pyR]ÐsX"( %    22 ) #36   cC`sut|jdtƒr.ddl}|j|ƒS|jtjjƒsatjj tjj|ƒ}ntjj|ƒSdS(s˜ Make sure that we put files into a standard path If a path is relative, then we need to choose where to put it. ssh chooses $HOME but we aren't guaranteed that a home dir will exist in any given chroot. So for now we're choosing "/" instead. This also happens to be the former default. Can revisit using $HOME instead if it's a problem RiN( RRRtntpathtnormpathRHRetpathtseptjoin(R(t remote_pathRz((sE/usr/lib/python2.7/site-packages/ansible/plugins/connection/docker.pyt_prefix_login_path s   c C`sÐtt|ƒj||ƒtjd||fd|jjƒ|j|ƒ}tj j t |ddƒƒs‚t dt |ƒƒ‚nt|ƒ}tt |ddƒdƒ!}tj|jƒƒjsÍd}nd}|j|jjd d |t|fgƒ}g|D]}t |ddƒ^q}y+tj|d |d tjd tjƒ}Wntk rmtdƒ‚nX|jƒ\}} |jdkrÆtdt |ƒt |ƒt |ƒt | ƒfƒ‚nWdQXdS(s0 Transfer a file from local to docker container s PUT %s TO %sRRRFRGs!file or module does not exist: %strbs count=0Rs-csdd of=%s bs=%s%sRZR3R4sCdocker connection requires dd command in the container to put filesis'failed to transfer file %s to %s: %s %sN(RRtput_fileRRUR#RLR€ReR|texistsRRR Rtopentfstattfilenotst_sizeRQR^R R7R8R9tOSErrorRR:R;( R(tin_pathtout_pathtin_filetcountR+RsR?R3R4((sE/usr/lib/python2.7/site-packages/ansible/plugins/connection/docker.pyR‚s,#  +% c C`s„tt|ƒj||ƒtjd||fd|jjƒ|j|ƒ}tj j |ƒ}|j dd|jj|f|g}g|D]}t |ddƒ^q‰}t j|dt jdt jd t jƒ}|jƒt|jd tƒrd d l}|j||j|ƒƒ}n!tj j|tj j|ƒƒ}|jd krI|j|jjd d|tfgƒ}g|D]}t |ddƒ^qy}tt |ddƒdƒ’} y+t j|dt jd| d t jƒ}Wntk rÿtdƒ‚nX|jƒ\} } |jd kr@td||| | fƒ‚nWd QXn||kr€tjt |ddƒt |ddƒƒnd S(s' Fetch a file from container to local. sFETCH %s TO %sRRtcps%s:%sRFRGRZR3R4RiNs-csdd if=%s bs=%stwbsCdocker connection requires dd command in the container to put filess$failed to fetch file %s to %s: %s %ststrict(RRt fetch_fileRRUR#RLR€ReR|tdirnameRRR7R8R9R:RRRRzR~tbasenameR;RQR^R R„RˆRtrename( R(R‰RŠtout_dirR+RsR?Rztactual_out_pathtout_fileR3R4((sE/usr/lib/python2.7/site-packages/ansible/plugins/connection/docker.pyR?s6#%%  !(% ( cC`s tt|ƒjƒt|_dS(s3 Terminate the connection. Nothing to do for DockerN(RRRpRRT(R(((sE/usr/lib/python2.7/site-packages/ansible/plugins/connection/docker.pyRpjsN(t__name__t __module__t__doc__t transportRVthas_pipeliningRt staticmethodR1RBRERR$RQR RSRR]R€R‚RRp(((sE/usr/lib/python2.7/site-packages/ansible/plugins/connection/docker.pyR=s  3    <  ! +(%t __future__RRRttypet __metaclass__t DOCUMENTATIONtdistutils.spawnRRbRetos.pathR7R.tdistutils.versionRtansible.constantst constantstCtansible.compatRtansible.errorsRRtansible.module_utils.six.movesRtansible.module_utils._textRR R tansible.plugins.connectionR R tansible.utils.displayR RR(((sE/usr/lib/python2.7/site-packages/ansible/plugins/connection/docker.pyt s$