-
Notifications
You must be signed in to change notification settings - Fork 247
/
Copy pathagent_dotnet.rb
44 lines (38 loc) · 920 Bytes
/
agent_dotnet.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#
# Cookbook:: newrelic
# Recipe:: agent_dotnet
#
# Copyright:: (c) 2016, David Joos
#
# include helper methods
include NewRelic::Helpers
action :install do
check_license
install_newrelic
end
action :remove do
remove_newrelic
end
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
template "#{new_resource.config_dir}/newrelic.config" do
cookbook new_resource.cookbook
source new_resource.source
variables(
resource: new_resource
)
sensitive true
end
end
def remove_newrelic
windows_package 'Remove New Relic .NET Agent' do
source new_resource.https_download
action :remove
end
end