
    Vhq                    6    d dl mZ dZd dlmZ  G d de      Zy)    )annotationsar  
name: sudosu
short_description: Run tasks using sudo su -
description:
  - This become plugin allows your remote/login user to execute commands as another user using the C(sudo) and C(su) utilities
    combined.
author:
  - Dag Wieers (@dagwieers)
version_added: 2.4.0
options:
  become_user:
    description: User you 'become' to execute the task.
    type: string
    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
  become_flags:
    description: Options to pass to C(sudo).
    type: string
    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
  become_pass:
    description: Password to pass to C(sudo).
    type: string
    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
  alt_method:
    description:
      - Whether to use an alternative method to call C(su). Instead of running C(su -l user /path/to/shell -c command), it
        runs C(su -l user -c command).
      - Use this when the default one is not working on your system.
    required: false
    type: boolean
    ini:
      - section: community.general.sudosu
        key: alternative_method
    vars:
      - name: ansible_sudosu_alt_method
    env:
      - name: ANSIBLE_SUDOSU_ALT_METHOD
    version_added: 9.2.0
)
BecomeBasec                  *     e Zd ZdZdZdZ fdZ xZS )BecomeModulezcommunity.general.sudosu)zSorry, try again.)z)Sorry, a password is required to run sudozsudo: a password is requiredc                   t         t        |   ||       |s|S d}| j                  d      xs d}d}| j                  d      r9d| j                   d| _        |r|j                  dd      }d| j
                   d	}| j                  d
      xs d}|r| }| j                  d      r!| d| d| d| d| j                  ||d       	S | d| d| d| d| j                  ||       	S )Nsudobecome_flags become_passz[sudo via ansible, key=z] password:z-nz-p ""become_user
alt_method z su -l z -c T)superr   build_become_command
get_option_idpromptreplace_build_success_command)selfcmdshell	becomecmdflagsr   user	__class__s          k/home/dcms/DCMS/lib/python3.12/site-packages/ansible_collections/community/general/plugins/become/sudosu.pyr   z!BecomeModule.build_become_commandZ   s   lD6sEBJ	/52??=)3DHH:[IDKdB/DKK=*F}-3VD??<([%&d4C^C^_bdikoCpBqrr[%&a@[@[\_af@g?hii    )__name__
__module____qualname__namefailmissingr   __classcell__)r   s   @r   r   r   R   s     %D "D[Gj jr   r   N)
__future__r   DOCUMENTATIONansible.plugins.becomer   r    r   r   <module>r+      s&   
 #EP .j: jr   