win_msi issues with Ansible 2.1

56 views
Skip to first unread message

skinnedknuckles

unread,
May 6, 2016, 11:06:07 AM5/6/16
to Ansible Project
Management Node running:
Ansible 2.1
Centos 7
Remote Node running:
Windows 7
Powershell 3

The playbook below appears to run without errors but nothing happens on the remote node.  

--- 
- hosts: windows
  tasks: 
     - name: DiceTis Installer
       win_msi: path="C:\\Users\\ads-6999\\Desktop\\SetupADS800DiceTIS.msi" create="C\\Program Files\\SetupADS800DiceTIS\\ADS800DiceTIS.exe" state=present 



As I understand the -sudo flag has been deprecated to the -become flag which I tried to use as shown below

--- 
- hosts: windows
  tasks: 
     - name: DiceTis Installer
       become: yes
       become_method: sudo
       win_msi: path="C:\\Users\\ads-6999\\Desktop\\SetupADS800DiceTIS.msi" create="C\\Program Files\\SetupADS800DiceTIS\\ADS800DiceTIS.exe" state=present 


but then I get the powershell error "The term sudo is not recognized as the name of a cmdlet, function or operable program"

Any ideas?

J Hawkesworth

unread,
May 6, 2016, 2:19:52 PM5/6/16
to Ansible Project
Hi

Become isn't really a thing you can do on windows hosts (yet, I believe).

You'll most likely need administrative privileges for the user you are accessing the windows host as in order to install .msi files.

I think the parameter needs to be 'creates' not 'create'

If possible I'd recommend using win_package as in my experience it handles a wider variety of .msi files than the msi module.

You can use the product_id to stop it re-attempting installing.  You can find the product ids for anything you have installed by looking in the following locations in the registry:

HKLM:SoftwareMicrosoftWindowsCurrentVersionUninstall or HKLM:SoftwareWow6432NodeMicrosoftWindowsCurrentVersion\Uninstall

skinnedknuckles

unread,
May 6, 2016, 4:38:13 PM5/6/16
to Ansible Project
Okay it's working now.  I had read about win_package but had never been able to find the product_id until reading your post.  Thanks so much.
Reply all
Reply to author
Forward
0 new messages