This repository has been archived by the owner on Apr 5, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Merge pull request #252 from a-know/newrelic-infrastructure
Newrelic infrastructure
- Loading branch information
Showing
10 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"id": "newrelic-infrastructure", | ||
"license_key": { | ||
"encrypted_data": "2b6xU/9ub66kWcpsVkM7eohfYXYMxWzjMCwFFwymoUAzyYqAVAKMpfUnL8dj\nK44HDr1YwdJpyzPq6H0=\n", | ||
"iv": "IfbOUz3vxx8cSylY\n", | ||
"auth_tag": "Xhy8HwbZpaoQKoqZXDh0kg==\n", | ||
"version": 3, | ||
"cipher": "aes-256-gcm" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name 'newrelic-infrastructure' | ||
maintainer 'a-know' | ||
license 'All rights reserved' | ||
description 'Installs/Configures NewRelic Infrastructure' | ||
long_description 'ditto' # IO.read(File.join(File.dirname(__FILE__), 'README.md')) | ||
version '0.1.0' | ||
depends 'yumrepo' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
include_recipe 'yumrepo::newrelic-infrastructure' | ||
|
||
mackerel_credentials = Chef::EncryptedDataBagItem.load('credentials', 'newrelic-infrastructure') | ||
|
||
template '/etc/newrelic-infra.yml' do | ||
owner 'root' | ||
group 'root' | ||
mode '0644' | ||
variables license_key: mackerel_credentials['license_key'] | ||
end | ||
|
||
execute 'yum cache clear' do | ||
user 'root' | ||
command "yum -q makecache -y --disablerepo='*' --enablerepo='newrelic-infra'" | ||
end | ||
|
||
yum_package 'newrelic-infra' |
1 change: 1 addition & 0 deletions
1
site-cookbooks/newrelic-infrastructure/templates/default/newrelic-infra.yml.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
license_key: <%= @license_key %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[newrelic-infra] | ||
name=New Relic Infrastructure | ||
baseurl=http://download.newrelic.com/infrastructure_agent/linux/yum/el/7/x86_64 | ||
gpgkey=http://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg | ||
gpgcheck=1 | ||
repo_gpgcheck=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
cookbook_file '/etc/yum.repos.d/newrelic-infra.repo' do | ||
action :create_if_missing | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
shared_examples 'newrelic-infrastructure' do | ||
describe package 'newrelic-infra' do | ||
it { should be_installed } | ||
end | ||
|
||
describe service 'newrelic-infra' do | ||
it { should be_enabled } | ||
it { should be_running } | ||
end | ||
end |