playbook to install software on windows clients from linux control machine

2,613 views
Skip to first unread message

priya.n...@gmail.com

unread,
Jun 17, 2015, 1:21:12 PM6/17/15
to ansible...@googlegroups.com
Hi,

I am trying to write a playbook which will install windows software(exe files) on windows client machine from the control machine (software is on control machine)

I want to either copy the software onto Windows machine and then install using ansible or directly install on the windows machine from the control.

Please help, i tried to search in google for help but no luck,

Much appreciated for help.

Thanks.

benno joy

unread,
Jun 17, 2015, 10:55:52 PM6/17/15
to ansible...@googlegroups.com
Hi,

Did yo try using the win_copy module to copy across the package and installing it via win_msi module or your own script to install it issued via the script module.



--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/89c6dec4-70a1-42bb-9592-56f5c5727806%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Trond Hindenes

unread,
Jun 18, 2015, 5:51:59 AM6/18/15
to ansible...@googlegroups.com
win_copy is a bad idea. WinRM is simply not built for transferring binary files. The recommendation is to have the file accessible on a UNC path/url and then use win_package to get it onto the windows machine.

priya.n...@gmail.com

unread,
Jun 19, 2015, 11:20:08 AM6/19/15
to ansible...@googlegroups.com
win_copy does not work as the file size is around 300MB. I need to deploy the package on to number of windows clients and install it. Is win_package released module, i couldnt find it.

Another way i tried was to use win_get_url to download the package, but it looks like each client calls ftp to download causing overhead.

Any ideas, please help,

Thanks

J Hawkesworth

unread,
Jun 24, 2015, 4:53:19 PM6/24/15
to ansible...@googlegroups.com
I think you are most likely to be successful if you set up a web server on your ansible controller and then use win_get_url to fetch and then run the .exe to install (or use win_package as suggested above as I believe this will retrieve from http and install). 

Bear in mind you will have almost the same amount of traffic if you push from your ansible controller to each of your windows hosts as you would if you asked each of your clients to fetch from your controller.  You would still be transferring roughly the same amount of data regardless of whether you did this via http, cifs (windows file sharing) or another protocol.

You could even use something like varnish to cache the http response into RAM to speed up subsequent requests for the same file, but probably not worth it if you are only have a small number of windows hosts to manage.

Jon

Trond Hindenes

unread,
Jun 24, 2015, 6:47:20 PM6/24/15
to ansible...@googlegroups.com
win_package is currently PRed waiting for a friendly +1 to get it merged into modules-extras. You can find it here in the meantime:

priya.n...@gmail.com

unread,
Jun 25, 2015, 10:59:19 AM6/25/15
to ansible...@googlegroups.com
To overcome this, I wrote a powershell script which will call "Get-SCPFile" cmdlet by Posh-SSH and was able to successfully copy the file from controlling node to windows clients.

Is win_package module going to be with ansible version 1.9.2 and anyone when stable version 1.9.2 is going to be released

Thanks

priya.n...@gmail.com

unread,
Jun 25, 2015, 11:04:46 AM6/25/15
to ansible...@googlegroups.com
Does win_package do a copy similar to win_copy? It would be good if we have a win module which will copy binary files with bigger size from controlling machine to clients. This will be easier for people who do not want to setup any ftp.

Thanks

Trond Hindenes

unread,
Jun 26, 2015, 9:44:32 AM6/26/15
to ansible...@googlegroups.com
Creatign a wrapper around the powershell ssh/scp module is a very good idea. We should get on that.

win_package simply takes a UNCpath/url/local path to install the package. It won't directly solve your problem as far as I can see.

Deepa Yr

unread,
Mar 8, 2016, 2:25:46 AM3/8/16
to Ansible Project
Were you able to resolve installation of exe files on windows ?

J Hawkesworth

unread,
Mar 8, 2016, 6:35:33 AM3/8/16
to Ansible Project
Hi Deepa

This thread is old, things have moved on.

win_package is now part of ansible 2.0 and win_copy is suitable for transferring files from your ansible controller to your windows machines.

Hope this helps,

Jon
Reply all
Reply to author
Forward
0 new messages