Limitations of become on Windows
Running a task withasyncandbecomeon Windows Server 2008, 2008 R2
and Windows 7 only works when using Ansible 2.7 or newer.By default, the become user logs on with an interactive session, so it must
have the right to do so on the Windows host. If it does not inherit theSeAllowLogOnLocallyprivilege or inherits theSeDenyLogOnLocallyprivilege, the become process will fail. Either add the privilege or set thelogon_typeflag to change the logon type used.Prior to Ansible version 2.3, become only worked whenansible_winrm_transportwas eitherbasicorcredssp. This
restriction has been lifted since the 2.4 release of Ansible for all hosts
except Windows Server 2008 (non R2 version).The Secondary Logon serviceseclogonmust be running to useansible_become_method:runasThe connection user must already be an Administrator on the Windows host to
userunas. The target become user does not need to be an Administrator
though.