Skip to content

Commit

Permalink
Fix windows chocolatey package upgrade
Browse files Browse the repository at this point in the history
If an older version is already installed
- we need to stop the service so files will not be in use
  • Loading branch information
snkutlu committed Oct 11, 2018
1 parent 46ee21c commit e26de79
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions resources/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@
end

if platform_family? 'windows'
if telegraf_install?
service "telegraf_#{new_resource.name}" do
service_name 'telegraf'
action [:stop]
only_if { ::Win32::Service.exists?('telegraf') }
end
end

chocolatey_package 'telegraf' do
version new_resource.install_version
source node['telegraf']['chocolatey_source']
Expand Down

0 comments on commit e26de79

Please sign in to comment.