Skip to content
This repository was archived by the owner on Apr 21, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
source 'https://rubygems.org'

group :development, :test do
gem 'facter', :require => false
# gem 'hiera-puppet-helper', :require => false
gem 'puppet-lint', :require => false
gem 'puppetlabs_spec_helper', :require => false
gem 'rake', :require => false
gem 'rspec-puppet', :require => false
gem 'rspec-system', :require => false
gem 'rspec-system-puppet', :require => false
gem 'rspec-system-serverspec', :require => false
end

if puppetversion = ENV['PUPPET_GEM_VERSION']
gem 'puppet', puppetversion, :require => false
else
gem 'puppet', :require => false
end

# vim:ft=ruby
2 changes: 1 addition & 1 deletion manifests/aws_cloudwatch.pp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
$agents,
$version = $newrelic_plugins::params::aws_cloudwatch_version,
$regions = [],
) inherits params {
) inherits ::newrelic_plugins::params {

include stdlib

Expand Down
2 changes: 1 addition & 1 deletion manifests/example.pp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
$install_path,
$user,
$version = $newrelic_plugins::params::example_version,
) inherits params {
) inherits ::newrelic_plugins::params {

include stdlib

Expand Down
2 changes: 1 addition & 1 deletion manifests/f5.pp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
$user,
$version = $newrelic_plugins::params::f5_version,
$agents,
) inherits params {
) inherits ::newrelic_plugins::params {

include stdlib

Expand Down
23 changes: 21 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,26 @@
# class { 'newrelic_plugins': }
#
class newrelic_plugins(
) inherits params {
$aws_cloudwatch_download_baseurl = $::newrelic_plugins::params::aws_cloudwatch_download_baseurl,
$aws_cloudwatch_version = $::newrelic_plugins::params::aws_cloudwatch_version,
$example_download_baseurl = $::newrelic_plugins::params::example_download_baseurl,
$example_version = $::newrelic_plugins::params::example_version,
$f5_version = $::newrelic_plugins::params::f5_version,
$memcached_java_download_baseurl = $::newrelic_plugins::params::memcached_java_download_baseurl,
$memcached_java_options = $::newrelic_plugins::params::memcached_java_options,
$memcached_java_version = $::newrelic_plugins::params::memcached_java_version,
$memcached_ruby_download_baseurl = $::newrelic_plugins::params::memcached_ruby_download_baseurl,
$memcached_ruby_version = $::newrelic_plugins::params::memcached_ruby_version,
$mysql_download_baseurl = $::newrelic_plugins::params::mysql_download_baseurl,
$mysql_java_options = $::newrelic_plugins::params::mysql_java_options,
$mysql_version = $::newrelic_plugins::params::mysql_version,
$nokogiri_packages = $::newrelic_plugins::params::nokogiri_packages,
$rackspace_load_balancers_download_baseurl = $::newrelic_plugins::params::rackspace_load_balancers_download_baseurl,
$rackspace_load_balancers_version = $::newrelic_plugins::params::rackspace_load_balancers_version,
$wikipedia_example_java_download_baseurl = $::newrelic_plugins::params::wikipedia_example_java_download_baseurl,
$wikipedia_example_java_version = $::newrelic_plugins::params::wikipedia_example_java_version,
$wikipedia_example_ruby_download_baseurl = $::newrelic_plugins::params::wikipedia_example_ruby_download_baseurl,
$wikipedia_example_ruby_version = $::newrelic_plugins::params::wikipedia_example_ruby_version,
) inherits ::newrelic_plugins::params {

}

2 changes: 1 addition & 1 deletion manifests/memcached_java.pp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
$version = $newrelic_plugins::params::memcached_java_version,
$servers,
$java_options = $newrelic_plugins::params::memcached_java_options,
) inherits params {
) inherits ::newrelic_plugins::params {

include stdlib

Expand Down
2 changes: 1 addition & 1 deletion manifests/memcached_ruby.pp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
$user,
$version = $newrelic_plugins::params::memcached_ruby_version,
$agents,
) inherits params {
) inherits ::newrelic_plugins::params {

include stdlib

Expand Down
13 changes: 7 additions & 6 deletions manifests/mysql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,13 @@
$plugin_template = 'newrelic_plugins/mysql/plugin.json.erb',
$service_enable = true,
$service_ensure = running,
) inherits params {

) inherits ::newrelic_plugins::params {
include newrelic_plugins
include stdlib

# verify java is installed
newrelic_plugins::resource::verify_java { 'MySQL Plugin': }
# TODO: Find a better way to do this.
# newrelic_plugins::resource::verify_java { 'MySQL Plugin': }

# verify attributes
validate_absolute_path($install_path)
Expand All @@ -115,7 +116,7 @@
newrelic_plugins::resource::install_plugin { 'newrelic_mysql_plugin':
install_path => $install_path,
plugin_path => $plugin_path,
download_url => "${$newrelic_plugins::params::mysql_download_baseurl}-${version}.tar.gz",
download_url => "${::newrelic_plugins::mysql_download_baseurl}-${version}.tar.gz",
version => $version,
user => $user
}
Expand Down Expand Up @@ -150,8 +151,8 @@
}

# ordering
Newrelic_plugins::Resource::Verify_java['MySQL Plugin']
->
# Newrelic_plugins::Resource::Verify_java['MySQL Plugin']
# ->
Newrelic_plugins::Resource::Verify_license_key['MySQL Plugin: Verify New Relic License Key']
->
Newrelic_plugins::Resource::Install_plugin['newrelic_mysql_plugin']
Expand Down
2 changes: 1 addition & 1 deletion manifests/rackspace_load_balancers.pp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
$api_key,
$region,
$version = $newrelic_plugins::params::rackspace_load_balancers_version,
) inherits params {
) inherits ::newrelic_plugins::params {

include stdlib

Expand Down
6 changes: 3 additions & 3 deletions manifests/resource/install_plugin.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@

# download plugin tar file
exec { "curl ${tar_file}":
command => "curl -L -o ${tar_file} ${download_url}",
command => "curl -s -L -o '${tar_file}' '${download_url}'",
cwd => $install_path,
path => $::path,
user => $user,
onlyif => "test -d ${install_path}",
unless => "test -f ${tar_file}",
onlyif => "test -d '${install_path}'",
unless => "test -f '${tar_file}'",
notify => Exec["${name}: create ${plugin_path}"]
}

Expand Down
2 changes: 1 addition & 1 deletion manifests/wikipedia_example_java.pp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
$install_path,
$user,
$version = $newrelic_plugins::params::wikipedia_example_java_version
) inherits params {
) inherits ::newrelic_plugins::params {

include stdlib

Expand Down
2 changes: 1 addition & 1 deletion manifests/wikipedia_example_ruby.pp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
$install_path,
$user,
$version = $newrelic_plugins::params::wikipedia_example_ruby_version,
) inherits params {
) inherits ::newrelic_plugins::params {

include stdlib

Expand Down
10 changes: 9 additions & 1 deletion spec/classes/newrelic_plugins_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,13 @@
end
end
end
end

context "osfamily = Debian" do
let(:facts) {{
:osfamily => 'Debian',
}}
it { should contain_class('newrelic_plugins') }
it { should contain_class('newrelic_plugins::params') }
end

end