From bbb2ad19efbe2264a0721e1af9877343cde18801 Mon Sep 17 00:00:00 2001 From: Jaime Fullaondo Date: Fri, 3 Jun 2016 18:31:30 -0400 Subject: [PATCH 1/2] [reporting] PE and POSS require puppetserver_gem to get the dogapi gem in the JRuby env. [reporting] updating README. --- README.md | 4 +++- manifests/reports.pp | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index eaac0bef..1d48f3f9 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,8 @@ that needs to be done. puppet_run_reports => true, } - __To support reporting, your Puppet master needs to have the [dogapi](https://github.com/DataDog/dogapi-rb) gem installed, to do that either run the puppet agent on your master with this configuration or install it manually with `gem`__ + __To support reporting, your Puppet master needs to have the [dogapi](https://github.com/DataDog/dogapi-rb) gem installed, to do that either run the puppet agent on your master with this configuration or install it manually with `gem`.__ + _Please note if on Puppet Enterprise or POSS (ie. >=3.7.0) there is a soft dependency for reporting on the `puppetserver_gem` module. Install with `puppet module install puppetlabs-puppetserver_gem` - installing manually with `gem` will *not* work._ 3. Include any other integrations you want the agent to use, e.g. @@ -97,6 +98,7 @@ And on all of your Puppet client nodes add: # ... report=true + If you get err: Could not send report: diff --git a/manifests/reports.pp b/manifests/reports.pp index 0d5e157a..7873e227 100644 --- a/manifests/reports.pp +++ b/manifests/reports.pp @@ -21,6 +21,12 @@ include datadog_agent::params $rubydev_package = $datadog_agent::params::rubydev_package + $gemprovider = 'puppetserver_gem' + + # set the right provider + if (!defined('$::serverversion') or versioncmp($::serverversion, '3.7.0') < 0) { + $gemprovider = 'gem' + } # check to make sure that you're not installing rubydev somewhere else if ! defined(Package[$rubydev_package]) { @@ -48,7 +54,7 @@ package{'dogapi': ensure => 'installed', - provider => 'gem', + provider => $gemprovider, } } From 99ef9324155c7b72b645b6704a9b0cb9fb9c31f0 Mon Sep 17 00:00:00 2001 From: Jaime Fullaondo Date: Fri, 3 Jun 2016 18:31:30 -0400 Subject: [PATCH 2/2] [reporting] PE and POSS require puppetserver_gem to get the dogapi gem in the JRuby env. [reporting] updating README. [reporting] puppet DSL doesn't allow reassignment, use new var. --- README.md | 4 +++- manifests/reports.pp | 10 +++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index eaac0bef..1d48f3f9 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,8 @@ that needs to be done. puppet_run_reports => true, } - __To support reporting, your Puppet master needs to have the [dogapi](https://github.com/DataDog/dogapi-rb) gem installed, to do that either run the puppet agent on your master with this configuration or install it manually with `gem`__ + __To support reporting, your Puppet master needs to have the [dogapi](https://github.com/DataDog/dogapi-rb) gem installed, to do that either run the puppet agent on your master with this configuration or install it manually with `gem`.__ + _Please note if on Puppet Enterprise or POSS (ie. >=3.7.0) there is a soft dependency for reporting on the `puppetserver_gem` module. Install with `puppet module install puppetlabs-puppetserver_gem` - installing manually with `gem` will *not* work._ 3. Include any other integrations you want the agent to use, e.g. @@ -97,6 +98,7 @@ And on all of your Puppet client nodes add: # ... report=true + If you get err: Could not send report: diff --git a/manifests/reports.pp b/manifests/reports.pp index 0d5e157a..5e10ebbb 100644 --- a/manifests/reports.pp +++ b/manifests/reports.pp @@ -21,6 +21,14 @@ include datadog_agent::params $rubydev_package = $datadog_agent::params::rubydev_package + $gemprovider = 'puppetserver_gem' + + # set the right provider + if (!defined('$::serverversion') or versioncmp($::serverversion, '3.7.0') < 0) { + $_gemprovider = 'gem' + } else { + $_gemprovider = $gemprovider + } # check to make sure that you're not installing rubydev somewhere else if ! defined(Package[$rubydev_package]) { @@ -48,7 +56,7 @@ package{'dogapi': ensure => 'installed', - provider => 'gem', + provider => $_gemprovider, } }