
    Vh                    F    d dl mZ dZd dlZd dlZd dlmZ  G d de      Zy)    )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)
BecomeBasec                  *     e Zd ZdZdZdZ fdZ xZS )BecomeModulesudo)zSorry, try again.)z)Sorry, a password is required to run sudozsudo: a password is requiredc           
     n   t         t        |   ||       |s|S | j                  d      xs | j                  }| j                  d      xs d}d}| j                  d      rd| j
                  z  | _        |rog }t        j                  |      D ]@  }|dv r|j                  d      st        j                  dd	|      }|j                  |       B t        j                  |      }d
| j                  z  }| j                  d      xs d}|rd|z  }dj                  ||||| j                  ||      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__s
            K/home/dcms/DCMS/lib/python3.12/site-packages/ansible/plugins/become/sudo.pyr   z!BecomeModule.build_become_command[   s%   lD6sEBJOOL1>TYY	/52??=)@488KDK!KK. (D:: !__T2!vv&8'4HMM$'( 

6*$++.F}-3d#DxxE649T9TUXZ_9`abb    )__name__
__module____qualname__r   failmissingr   __classcell__)r%   s   @r&   r   r   S   s     D "D[Gc cr'   r   )
__future__r   DOCUMENTATIONr   r   ansible.plugins.becomer   r    r'   r&   <module>r2      s,    #EN 
  -%c: %cr'   