Deploy MSI package from Sonatype Nexus using chef


#1

I want to install the msi package from sonatype Nexus using Chef. Here what I need to achieve is , If the new version of msi is arrived in nexus repository chef should take the latest and deploy it automatically.

Can you tell me how can I do it.

Thanks, Ram


#2

You want to use the windows_package and if you want to automatically want to install the latest version, make sure not to specify a version or a checksum:

windows_package 'my_software' do
  source 'http://my/nexus/repo/package.msi'
end

Note that this is not idempotent and that file will be downloaded on every chef run. It also assumes that every new version of the MSI will have the exact same url.


#3

For the record this is a cross post from StackOverflow: https://stackoverflow.com/questions/39136722/deploy-msi-package-from-sonatype-nexus-using-chef

@ramaduraiu Please don’t immediately cross-post questions as it means you’ll use up 2x the time from our volunteers to answer you.


#4

@coderanger Sure . But I couldn’t get the correct answer from that post That was why I put it.


#5

Thank you @Matt_Wrock


#6

For working with Nexus I can really recommend the artifact cookbook [1]. It should work like this:

nexus_configuration_object = Chef::Artifact::NexusConfiguration.new("http://nexus-url", "snapshots", "username", "password")

artifact_package "tomcat" do
  location "com.rpm:tomcat:msi:1.2.3"
  nexus_configuration nexus_configuration_object
  action :install
end

[1] https://github.com/RiotGamesCookbooks/artifact-cookbook