Skip to content

runas

Collection Note

This module is part of the ansible.builtin collection. To install the collection, use:

ansible-galaxy collection install ansible.builtin
Added in version 2.8.

Synopsis

  • This become plugin allows your remote/login user to execute commands as another user via the windows runas facility.

Parameters

Parameter Defaults / Choices Comments
become_flags Options to pass to runas, a space delimited list of k=v pairs
Env: ANSIBLE_BECOME_FLAGS
Env: ANSIBLE_RUNAS_FLAGS
become_pass password
Env: ANSIBLE_BECOME_PASS
Env: ANSIBLE_RUNAS_PASS
become_user
required
User you 'become' to execute the task
Env: ANSIBLE_BECOME_USER
Env: ANSIBLE_RUNAS_USER

Notes

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

Authors

  • Ansible (@core)