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, } }