win_msi not installig the msi package

350 views
Skip to first unread message

megha sharma

unread,
Jul 26, 2016, 10:09:34 AM7/26/16
to Ansible Project
Hi,

I am using Ansible 2.1.0.0 and trying to run the below playbook

 - name: Install 7 zip
      win_msi:
        extra_args: "/quiet"
        path: 'C:\path\7z1602-x64.msi'
        state: present


Output:
TASK [Install 7 zip] ***********************************************************
changed: [10.155.208.130]

PLAY RECAP *********************************************************************
10.155.208.130             : ok=3    changed=1    unreachable=0    failed=0


But installation of the 7 zip is not happening.
Please help.

J Hawkesworth

unread,
Jul 27, 2016, 1:15:09 AM7/27/16
to Ansible Project
I recommend using win_package instead of win_msi

If you still want to use win_msi I recommend setting wait: true as this seems to make it run more reliably on Server 2008 R2 / Powershell 3.0.  However I haven't seen your case where it appears to fail silently.  I assume you have previously downloaded the 7z1602-x64.msi to c:\Path folder?


 - name: Install 7 zip
      win_msi:
        extra_args: "/quiet"
        path: 'C:\path\7z1602-x64.msi'
        state: present
        wait: true

Might be worth running your playbook with -v to see if there is any log output produced.

One other thing to check is that your windows host is 64-bit - if it isn't you'll need the x86.msi instead of the x64.msi file

Hope this helps,

Jon

megha sharma

unread,
Jul 28, 2016, 2:36:53 AM7/28/16
to Ansible Project
Hi,

In order to use win_package I need Product Id of the respective msi/exe.I can get the product Id of an already installed msi/exe but what if it is a new package to be installed, how will i get the product Id of a new package.

Thanks,
Megha

J Hawkesworth

unread,
Jul 29, 2016, 12:20:59 PM7/29/16
to Ansible Project
You can do a manual installation and then look in the registry in HKLM:Software\Microsoft\Windows\CurrentVersion\Uninstall or for 32 bit programsHKLM:Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall

Or you can just a fake product id, install it and then find the product id and fix your playbook to have the correct product id

Jon
Reply all
Reply to author
Forward
0 new messages