DataDog / puppet-datadog-agent

Puppet module to install the Datadog agent
Other
52 stars 261 forks source link

Reports Broken with Beta6 location assumptions #385

Open scottgeary opened 6 years ago

scottgeary commented 6 years ago

With the recent changes to allow for a seperate install of the beta agent, the puppet report ruby code has been hard-coded to use this new path, without checking the ::apt_agent6_beta_repo fact.

(/File[/var/lib/puppet/lib/puppet/reports/datadog_reports.rb]/content)    raise(Puppet::ParseError, "Datadog report config file #{configfile} not readable") unless File.readable?(configfile)
(/File[/var/lib/puppet/lib/puppet/reports/datadog_reports.rb]/content)
(/File[/var/lib/puppet/lib/puppet/reports/datadog_reports.rb]/content) --- /var/lib/puppet/lib/puppet/reports/datadog_reports.rb    2018-01-11 04:50:04.225326879 +0000

(/File[/var/lib/puppet/lib/puppet/reports/datadog_reports.rb]/content) -  configfile = "/etc/dd-agent/datadog.yaml"
(/File[/var/lib/puppet/lib/puppet/reports/datadog_reports.rb]/content) +  configfile = "/etc/datadog-agent/datadog-reports.yaml"

(/File[/var/lib/puppet/lib/puppet/reports/datadog_reports.rb]/content) +++ /tmp/puppet-file20180111-23546-m3k50s    2018-01-11 05:24:20.869404717 +0000
(/File[/var/lib/puppet/lib/puppet/reports/datadog_reports.rb]/content)  Puppet::Reports.register_report(:datadog_reports) do
(/File[/var/lib/puppet/lib/puppet/reports/datadog_reports.rb]/content)    API_KEY = config[:datadog_api_key]
(/File[/var/lib/puppet/lib/puppet/reports/datadog_reports.rb]/content) @@ -9,7 +9,7 @@
(/File[/var/lib/puppet/lib/puppet/reports/datadog_reports.rb]/content)
(/File[/var/lib/puppet/lib/puppet/reports/datadog_reports.rb]/content)    config = YAML.load_file(configfile)
(/File[/var/lib/puppet/lib/puppet/reports/datadog_reports.rb]/content)
puppet --version
3.8.7

Introduced at: https://github.com/DataDog/puppet-datadog-agent/commit/73fe2f4b75c60b7e059567a71018ec5fcecac55d#diff-1320d92e743637b43a853f153028633aL12

I'm a little unsure if facts are available during the execution of the report script, but we probably shouldn't be making the beta6 code default until it's released.

truthbk commented 6 years ago

Thanks @scottgeary looking into this 🙇

scottgeary commented 6 years ago

FYI: As a work-around to get Reports running again, we've symlinked the two files:

file {
      '/etc/datadog-agent/datadog-reports.yaml':
        ensure => 'link',
        target => '/etc/dd-agent/datadog.yaml',
        require => File['/etc/datadog-agent'];
    }
truthbk commented 6 years ago

@scottgeary I don't think this is still a problem in 2.x... Are you still experiencing this with the newer module versions?