From aba33d731107f5c2f7dad17fd6b9192984548c5e Mon Sep 17 00:00:00 2001 From: James Awesome Date: Tue, 8 Mar 2016 14:56:48 -0500 Subject: [PATCH] do not try and re-install --- metadata.rb | 2 +- recipes/debian.rb | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/metadata.rb b/metadata.rb index c8a5618f..5d64ad54 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ license 'Apache v2.0' description 'Installs/Configures sumologic-collector' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '2.0.1' +version '2.0.2' attribute 'sumologic/credentials/bag_name', display_name: "Credentials bag name", type: "string", diff --git a/recipes/debian.rb b/recipes/debian.rb index 7917b74b..8cc9ea71 100644 --- a/recipes/debian.rb +++ b/recipes/debian.rb @@ -1,10 +1,13 @@ -remote_file "#{Chef::Config[:file_cache_path]}/sumocollector.deb" do - source node['sumologic']['collectorDEBUrl'] -end -dpkg_package 'sumocollector' do - source "#{Chef::Config[:file_cache_path]}/sumocollector.deb" - action :install +unless ::File.exists?(node['sumologic']['installDir']) + remote_file "#{Chef::Config[:file_cache_path]}/sumocollector.deb" do + source node['sumologic']['collectorDEBUrl'] + end + + dpkg_package 'sumocollector' do + source "#{Chef::Config[:file_cache_path]}/sumocollector.deb" + action :install + end end service 'collector' do