ansible.builtin.runas become – Run As user
This become plugin is part of
ansible-core and included in all Ansible
installations. In most cases, you can use the short
However, we recommend you use the Fully Qualified Collection Name (FQCN)
ansible.builtin.runas 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
This become plugin allows your remote/login user to execute commands as another user via the windows runas facility.
Options to pass to runas, a space delimited list of k=v pairs
User you ‘become’ to execute the task
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