djoos-cookbooks / newrelic

Development repository for the newrelic cookbook
https://supermarket.chef.io/cookbooks/newrelic
MIT License
143 stars 245 forks source link

Remove action for newrelic_agent_dotnet doesn't seem to work #338

Open scolligan opened 6 years ago

scolligan commented 6 years ago

Hello,

In my testing today, I'm unable to get the dotnet agent to uninstall using the following code:

# set flag to indicate if newrelic agents should be removed based on presence of tag
should_remove = tagged?('ops-remove-newrelic')

Chef::Log.info("should_remove = #{should_remove}")

# install newrelic apm agent
newrelic_agent_dotnet 'NewRelic APM Agent' do
  license node['jjk_ts_transport_webserver_newrelic']['license_key']
  action (should_remove ? :remove : :install)
end

I've also tried explicitly using the :remove action, but the chef-client output continues to say the resource is up to date.

OS: Windows Server 2016 on Azure Cookbook Version: 2.35.0 Chef Client: 13.8.5

Thanks,

Sean

djoos commented 6 years ago

Hi @scolligan,

thanks for reaching out!

Was the windows_package resource called at all with action remove? Would you mind posting the output of your chef client run?

Thanks in advance! David