Closed nvyas1015 closed 2 years ago
Any updates on this one?
Would this be best handled in a wrapper cookbook, given the "levers" (:remove + :install) are available on the agent_dotnet resource? The alternative I could see is an additional action "upgrade" on the resource that would then bring this new behaviour in, but I'm (at the moment) more hesitant to go for that option.
Let me know what your thoughts are - thanks in advance for your feedback!
By default what cookbook does is the installation part. I am looking for the upgrade action. Why are you hesitant to make that change? Does it breaks something?
I was considering adding in a "update" action on the resource, which would simply push that action down to the windows_package resource. However, the windows_package resource doesn't have an update action.
Wrapping install and remove into an update on the New Relic .NET agent resource, feels to me responsibility that belongs in a wrapper cookbook, as it'll surely need some additional padding. So, right now the cookbook provides an idempotent way to install and remove, whilst an upgrade would come with additional "yak shaving" that I currently wouldn't want to add into the cookbook.
P.S. Once you have a wrapper cookbook, feel free to share (ie. reopen this issue or create a PR utilising the logic you came up with in the wrapper cookbook) and I would be happy to pick up the discussion though!
current cookbook doesnot upgrade APM agent.
def install_newrelic windows_package 'Install New Relic .NET Agent' do source new_resource.https_download options "/qb NR_LICENSE_KEY=#{new_resource.license} INSTALLLEVEL=#{new_resource.install_level}" installer_type :msi action :install **not_if { ::File.exist?('C:\\Program Files\\New Relic\\.NET Agent') }** end