- Docs »
- ansible.builtin.runas – Run As user
-
You are reading the latest community version of the Ansible documentation. Red Hat subscribers, select 2.9 in the version selection to the left for the most recent Red Hat release.
ansible.builtin.runas – Run As user
Note
This module is part of ansible-base
and included in all Ansible
installations. In most cases, you can use the short module name
runas even without specifying the collections:
keyword.
Despite that, we recommend you use the FQCN for easy linking to the module
documentation and to avoid conflicting with other collections that may have
the same module name.
New in version 2.8: of ansible.builtin
- This become plugins allows your remote/login user to execute commands as another user via the windows runas facility.
Parameter |
Choices/Defaults |
Configuration |
Comments |
become_flags
string
|
Default:
""
|
ini entries:
[privilege_escalation] become_flags =
[runas_become_plugin] flags =
env:ANSIBLE_BECOME_FLAGS
env:ANSIBLE_RUNAS_FLAGS
var: ansible_become_flags
var: ansible_runas_flags
|
Options to pass to runas, a space delimited list of k=v pairs
|
become_pass
string
|
|
ini entries:
[runas_become_plugin] password = None
env:ANSIBLE_BECOME_PASS
env:ANSIBLE_RUNAS_PASS
var: ansible_become_password
var: ansible_become_pass
var: ansible_runas_pass
|
password
|
become_user
string
/ required
|
|
ini entries:
[privilege_escalation] become_user = None
[runas_become_plugin] user = None
env:ANSIBLE_BECOME_USER
env:ANSIBLE_RUNAS_USER
var: ansible_become_user
var: ansible_runas_user
|
User you 'become' to execute the task
|
Note
- runas is really implemented in the powershell module handler and as such can only be used with winrm connections.
- This plugin ignores the ‘become_exe’ setting as it uses an API and not an executable.
- The Secondary Logon service (seclogon) must be running to use runas