How to Run program as an administrator

I am trying to run a software via win_package module. But that software requires running as administrator which causes my script stuck at one position. How to run it as administrator. I am running trough a user which a member of admin group. here is my code

  • name: installing Devexpress
    hosts: win
    gather_facts: yes
    become_method: runas

tasks:

  • name: installing DevExpress13
    win_package:
    path: D:\Soft\DevExpress13.exe
    arguments: /S /VERYSILENT
    state: present

https://docs.ansible.com/ansible/latest/user_guide/become.html#become-directives

Hi thanks for your reply.But I think win_package module does not support become parameter.

Any Windows module supports become, it’s implementation is completely independent from modules themselves. In the majority of situations a module is run as Administrator but there are a few cases where that may not apply. To test it out run

  • win_whoami:

You can also run it with become to test it out. If the Mandatory label in the groups section of the win_whoami output is High then it’s running as Administrator.