Skip to content

Commit a96ca0f

Browse files
Dan70402truthbk
authored andcommitted
Support system core integration (DataDog#359)
* Add support for system_core integration * fix build for ruby 2.0.0 * Revert "fix build for ruby 2.0.0" This reverts commit 6099ca9
1 parent 7fb3ae6 commit a96ca0f

3 files changed

Lines changed: 59 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Class: datadog_agent::integrations::system_core
2+
#
3+
# This class will install the necessary configuration for the system_core integration
4+
#
5+
# Sample Usage:
6+
# include 'datadog_agent::integrations::system_core'
7+
#
8+
#
9+
class datadog_agent::integrations::system_core inherits datadog_agent::params {
10+
include datadog_agent
11+
12+
file {
13+
"${datadog_agent::params::conf_dir}/system_core.yaml":
14+
ensure => file,
15+
owner => $datadog_agent::params::dd_user,
16+
group => $datadog_agent::params::dd_group,
17+
mode => '0644',
18+
content => template('datadog_agent/agent-conf.d/system_core.yaml.erb'),
19+
require => Package[$datadog_agent::params::package_name],
20+
notify => Service[$datadog_agent::params::service_name]
21+
}
22+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
require 'spec_helper'
2+
3+
describe 'datadog_agent::integrations::system_core' do
4+
let(:facts) {{
5+
operatingsystem: 'Ubuntu',
6+
}}
7+
let(:conf_dir) { '/etc/dd-agent/conf.d' }
8+
let(:dd_user) { 'dd-agent' }
9+
let(:dd_group) { 'root' }
10+
let(:dd_package) { 'datadog-agent' }
11+
let(:dd_service) { 'datadog-agent' }
12+
let(:conf_file) { "#{conf_dir}/system_core.yaml" }
13+
14+
it { should compile.with_all_deps }
15+
it { should contain_file(conf_file).with(
16+
owner: dd_user,
17+
group: dd_group,
18+
mode: '0644',
19+
)}
20+
it { should contain_file(conf_file).that_requires("Package[#{dd_package}]") }
21+
it { should contain_file(conf_file).that_notifies("Service[#{dd_service}]") }
22+
23+
context 'with default parameters' do
24+
it { should contain_file(conf_file).with_content(%r{instances:}) }
25+
it { should contain_file(conf_file).with_content(%r{ - foo: bar}) }
26+
end
27+
end
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#
2+
# MANAGED BY PUPPET
3+
#
4+
5+
init_config:
6+
7+
instances:
8+
# No configuration is needed for this check.
9+
# A single instance needs to be defined with any value.
10+
- foo: bar

0 commit comments

Comments
 (0)