forked from newrelic/infrastructure-agent-chef
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.rb
88 lines (78 loc) · 3.54 KB
/
default.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#
# Copyright (c) 2016-2017 New Relic, Inc.
#
# All rights reserved.
#
# Feature flags
# Whether or not to create a local service account for running the agent
default['newrelic_infra']['features']['manage_service_account'] = true
# Whether or not to install the New Relic on-host integrations
default['newrelic_infra']['features']['host_integrations'] = false
# Service account attributes
# Name of the service account user
default['newrelic_infra']['user']['name'] = 'newrelic_infra'
# Name of the service account group
default['newrelic_infra']['group']['name'] = 'newrelic_infra'
# New Relic infrastructure agent configuration options
default['newrelic_infra']['config'].tap do |conf|
# Account license key
conf['license_key'] = nil
# Override the auto-generated hostname for reporting
conf['display_name'] = nil
# Use a proxy to communicate with New Relic
conf['proxy'] = nil
# When set to 1, enables verbose logging for the agent
conf['verbose'] = 0
# Enable Golang debugging
conf['debug'] = nil
# To log to another location; when not set, the agent logs to the system log files
conf['log_file'] = nil
# A hash of custom attributes to annotate the data from this agent instance
conf['custom_attributes'] = {}
end
# New Relic infrastructure agent configuration file and directory properties
default['newrelic_infra']['agent'].tap do |conf|
conf['config']['file'] = 'agent.yaml'
conf['config']['mode'] = '0640'
conf['directory']['path'] = '/etc/newrelic-infra'
conf['directory']['mode'] = '0750'
end
# New Relic Infrastructure agent package configuration
default['newrelic_infra']['packages']['agent']['action'] = %i(install)
default['newrelic_infra']['packages']['agent']['version'] = nil
# New Relic Infrastructure on-host integration package configuration
# NOTE: The package actions only be performed if the associated feature flag is enabled.
default['newrelic_infra']['packages']['host_integrations']['action'] = %i(install)
default['newrelic_infra']['packages']['host_integrations']['version'] = nil
# New Relic Infrastructure on-host integration configuration
default['newrelic_infra']['host_integrations']['config_dir'] = '/etc/newrelic-infra/integrations.d'
default['newrelic_infra']['host_integrations']['config'] = {}
# New Relic Infrastructure on-host custom integration configuration
default['newrelic_infra']['custom_integrations'] = {}
# apt repository configuration for Debian based hosts
# See https://docs.chef.io/resource_apt_repository.html for more information
default['newrelic_infra']['apt'].tap do |conf|
conf['uri'] = 'https://download.newrelic.com/infrastructure_agent/linux/apt'
conf['key'] = 'https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg'
conf['distribution'] = node['lsb']['codename']
conf['components'] = %w(main)
conf['arch'] = 'amd64'
conf['action'] = %i(add)
end
# YUM repository configuration for RHEL based hosts
# See https://docs.chef.io/resource_yum_repository.html for more information
default['newrelic_infra']['yum'].tap do |conf|
conf['description'] = 'New Relic Infrastructure'
conf['baseurl'] = value_for_platform(
amazon: {
'>= 2013' => 'https://download.newrelic.com/infrastructure_agent/linux/yum/el/6/x86_64',
},
%w(redhat oracle centos) => {
default: "https://download.newrelic.com/infrastructure_agent/linux/yum/el/#{node['platform_version'].to_i}/x86_64",
}
)
conf['gpgkey'] = 'https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg'
conf['gpgcheck'] = true
conf['repo_gpgcheck'] = true
conf['action'] = %i(add makecache)
end