File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments