Skip to content

Commit b796a21

Browse files
o0oxidtruthbk
authored andcommitted
Custom integration defined type bugfix (DataDog#490)
1 parent c933dfe commit b796a21

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

manifests/integration.pp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@
1212

1313
if !$::datadog_agent::agent5_enable {
1414
$dst = "${datadog_agent::conf6_dir}/${integration}.d/conf.yaml"
15+
file { "${datadog_agent::conf6_dir}/${integration}.d":
16+
ensure => directory,
17+
owner => $datadog_agent::dd_user,
18+
group => $datadog_agent::dd_group,
19+
mode => '0755',
20+
before => File[$dst]
21+
}
1522
} else {
1623
$dst = "${datadog_agent::conf_dir}/${integration}.yaml"
1724
}

spec/defines/datadog_agent__integration_spec.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
if enabled
99
let(:conf_file) { '/etc/dd-agent/conf.d/test.yaml' }
1010
else
11-
let(:conf_file) { '/etc/datadog-agent/conf.d/test.d/conf.yaml' }
11+
let(:conf_dir) { '/etc/datadog-agent/conf.d/test.d' }
12+
let(:conf_file) { "#{conf_dir}/conf.yaml" }
1213
end
1314

1415
let (:title) { "test" }
@@ -23,7 +24,12 @@
2324
{ 'one' => "two" }
2425
]
2526
}}
27+
28+
2629
it { should compile }
30+
if enabled
31+
it { should contain_file("#{conf_dir}").that_comes_before("File[#{conf_file}]") }
32+
end
2733
it { should contain_file("#{conf_file}").with_content(/init_config: /) }
2834
gem_spec = Gem.loaded_specs['puppet']
2935
if gem_spec.version >= Gem::Version.new('4.0.0')

0 commit comments

Comments
 (0)