Become isn't necessarily used to 'run as administrator' in Windows but rather to change the logon from a network to interactive logon with credentials to use for delegation. Normally a WinRM process is run with the full Administrative rights of an account and you can verify that by running
- name: getlogon details for current user win_whoami: This will return a whole bunch of information but if the label key contains a 'High Mandatory Label' you know you are running as an admin. In older versions of Ansible, a become task may not have admin rights and since 2.5 it is done as a best effort attempt. I would do the below to verify you are least get the High Mandatory Label returned when using become to verify that process is run with admin rights as well. - name: test whoami with become win_whoami: become: yes become_method: runas become_user: Administrator As for why the process is still running it could be a few different things; - Become runs the task in a pseudo interactive logon so it may be prompting the user for something causing it to hang - The args you are using aren't the correct silent args for the process - Some else? What I would try - Run the same command locally and see if it works or not - Check the log file when being installed with Ansible to see if there's anything in there that might indicate what it's waiting for - Try running the task with async and become, this changes a few things with how the console is spawned and killed so may work for you - Use procexp to see what processes are still running, whether the main powershell exe that executes the module is still running, if setup.exe is still running and so on. Thanks Jordan -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/0d26fd84-2765-49ab-b297-198080141a6c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
