Skip to content

Commit

Permalink
Custom integration defined type bugfix (#490)
Browse files Browse the repository at this point in the history
  • Loading branch information
o0oxid authored and truthbk committed Feb 21, 2019
1 parent 6b7f5c8 commit 3e08b0b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions manifests/integration.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@

if !$::datadog_agent::agent5_enable {
$dst = "${datadog_agent::conf6_dir}/${integration}.d/conf.yaml"
file { "${datadog_agent::conf6_dir}/${integration}.d":
ensure => directory,
owner => $datadog_agent::dd_user,
group => $datadog_agent::dd_group,
mode => '0755',
before => File[$dst]
}
} else {
$dst = "${datadog_agent::conf_dir}/${integration}.yaml"
}
Expand Down
8 changes: 7 additions & 1 deletion spec/defines/datadog_agent__integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
if enabled
let(:conf_file) { '/etc/dd-agent/conf.d/test.yaml' }
else
let(:conf_file) { '/etc/datadog-agent/conf.d/test.d/conf.yaml' }
let(:conf_dir) { '/etc/datadog-agent/conf.d/test.d' }
let(:conf_file) { "#{conf_dir}/conf.yaml" }
end

let (:title) { "test" }
Expand All @@ -23,7 +24,12 @@
{ 'one' => "two" }
]
}}


it { should compile }
if enabled
it { should contain_file("#{conf_dir}").that_comes_before("File[#{conf_file}]") }
end
it { should contain_file("#{conf_file}").with_content(/init_config: /) }
gem_spec = Gem.loaded_specs['puppet']
if gem_spec.version >= Gem::Version.new('4.0.0')
Expand Down

0 comments on commit 3e08b0b

Please sign in to comment.