ansible.builtin.su become – Substitute User
Note
This become plugin is part of ansible-core and included in all Ansible installations. In most cases, you can use the short plugin name su. However, we recommend you use the Fully Qualified Collection Name (FQCN) ansible.builtin.su for easy linking to the plugin documentation and to avoid conflicting with other collections that may have the same become plugin name.
New in Ansible 2.8
Synopsis
- This become plugin allows your remote/login user to execute commands as another user via the su utility.
Parameters
Parameter | Comments |
|---|---|
become_exe string | Su executable Default: Configuration:
|
become_flags string | Options to pass to su Default: Configuration:
|
become_pass string | Password to pass to su Configuration:
|
become_user string | User you ‘become’ to execute the task Default: Configuration:
|
prompt_l10n list / elements=string | List of localized strings to match for prompt detection If empty we’ll use the built in one Do NOT add a colon (:) to your custom entries. Ansible adds a colon at the end of each prompt; if you add another one in your string, your prompt will fail with a “Timeout” error. Default: Configuration:
|
Note
Configuration entries listed above for each entry type (Ansible variable, environment variable, and so on) have a low to high priority order. For example, a variable that is lower in the list will override a variable that is higher up. The entry types are also ordered by precedence from low to high priority order. For example, an ansible.cfg entry (further up in the list) is overwritten by an Ansible variable (further down in the list).
Collection links
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/ansible/builtin/su_become.html