# How to install Package on Windows Remotely

I see that the way to install puppet packages on the windows platform goes like this

file { ...

}

package {

... require => File['<the installer="" file="">'] }

or ..

package { ... source -> '<unc path="">' }

I have some windows modules that need to be deployed in a LAN environment and also on EC2. I personally don't like the File and Package approach since you can get stuck with a lot large binaries on the local machine even after the successful installation of the Package.

On the other hand, having a UNC path just does not apply for scenarios where there are machines not members of a Domain like Vagrant Boxes or EC2 Machines.

Is there a way to accomplish something like ...

package{

.... source => '<http url="" or="" s3="" location="">' }

I believe i can accomplish the same purpose by using exec resource type but that should not be the case. The File resource type should not be used because the purpose is not to keep the file on the local machine and is to have the package installed.

edit retag close merge delete

What stops you from doing a clean up after the package has been installed? Something like: file {..ensure => absent, require => Package['....'],} It's fairly ugly, but gets the job done.

( 2014-08-20 04:29:05 -0500 )edit

Sort by » oldest newest most voted

As an example I've created a custom fact that determines the current version of Firefox. I simply add an if statement that says

(psuedo code) if $firefox_version !=$latest_version then file {'firefox': ensure => present} and package {'firefox_pkg': ensure => installed} else file{'firefox': ensure=>absent}

(This can actually be handled without checking the version since Firefox puts its version in the file name. I did this as a solution to other programs that didn't.)

more

What about using the staging module to grab the files first? https://forge.puppetlabs.com/nanliu/s... Then you could do that, put the file somewhere that the default package provider for Windows could recognize, and then cleanup the file afterwards?

more