win_msi not installig the msi package

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.

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

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

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