o n¾nhŽã@s@ddlmZdZddlZddlZddlmZGdd„deƒZdS)é)Ú annotationsaÒ name: sudo short_description: Substitute User DO description: - This become plugin allows your remote/login user to execute commands as another user via the sudo utility. author: ansible (@core) version_added: "2.8" options: become_user: description: User you 'become' to execute the task default: root ini: - section: privilege_escalation key: become_user - section: sudo_become_plugin key: user vars: - name: ansible_become_user - name: ansible_sudo_user env: - name: ANSIBLE_BECOME_USER - name: ANSIBLE_SUDO_USER keyword: - name: become_user become_exe: description: Sudo executable default: sudo ini: - section: privilege_escalation key: become_exe - section: sudo_become_plugin key: executable vars: - name: ansible_become_exe - name: ansible_sudo_exe env: - name: ANSIBLE_BECOME_EXE - name: ANSIBLE_SUDO_EXE keyword: - name: become_exe become_flags: description: Options to pass to sudo default: -H -S -n ini: - section: privilege_escalation key: become_flags - section: sudo_become_plugin key: flags vars: - name: ansible_become_flags - name: ansible_sudo_flags env: - name: ANSIBLE_BECOME_FLAGS - name: ANSIBLE_SUDO_FLAGS keyword: - name: become_flags become_pass: description: Password to pass to sudo required: False vars: - name: ansible_become_password - name: ansible_become_pass - name: ansible_sudo_pass env: - name: ANSIBLE_BECOME_PASS - name: ANSIBLE_SUDO_PASS ini: - section: sudo_become_plugin key: password N)Ú BecomeBasecs(eZdZdZdZdZ‡fdd„Z‡ZS)Ú BecomeModuleÚsudo)zSorry, try again.)z)Sorry, a password is required to run sudozsudo: a password is requiredc sàtt|ƒ ||¡|s |S| d¡p|j}| d¡pd}d}| d¡rUd|j|_|rPg}t |¡D]}|dvr9q2|  d¡sEt   dd |¡}|  |¡q2t  |¡}d |j}| d ¡p[d}|rbd |}d   ||||| ||¡g¡S)NÚ become_exeÚ become_flagsÚÚ become_passz$[sudo via ansible, key=%s] password:)z-nz--non-interactivez--z^(-\w*)n(\w*.*)z\1\2z-p "%s"Ú become_userz-u %sú )ÚsuperrÚbuild_become_commandÚ get_optionÚnameÚ_idÚpromptÚshlexÚsplitÚ startswithÚreÚsubÚappendÚjoinÚ_build_success_command) ÚselfÚcmdÚshellÚ becomecmdÚflagsrÚreflagÚflagÚuser©Ú __class__©úF/usr/local/lib/python3.10/dist-packages/ansible/plugins/become/sudo.pyr [s,      z!BecomeModule.build_become_command)Ú__name__Ú __module__Ú __qualname__rÚfailÚmissingr Ú __classcell__r$r$r"r%rSs r)Ú __future__rÚ DOCUMENTATIONrrÚansible.plugins.becomerrr$r$r$r%Ús G