Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ fixtures:
ruby: "git://github.com/puppetlabs/puppetlabs-ruby.git"
remote_file: "git://github.com/lwf/puppet-remote_file.git"
symlinks:
custom_datadog: "#{source_dir}/spec/custom_fixtures/custom_datadog"
datadog_agent: "#{source_dir}"
8 changes: 5 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ group :test do
end

group :development do
gem "beaker", '2.51.0'
gem "beaker-rspec"
gem "puppet-blacksmith"
gem "nokogiri", "~> 1.6.0"
gem "beaker", '2.51.0'
gem "guard-rake"
gem "hiera-eyaml"
gem "nokogiri", "~> 1.6.0"
gem "puppet-blacksmith"
gem "xmlrpc" if RUBY_VERSION >= '2.3'
end
13 changes: 12 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,21 @@
order => '05',
}

if ($extra_template != '') {
concat::fragment{ 'datadog extra_template footer':
target => '/etc/dd-agent/datadog.conf',
content => template($extra_template),
order => '06',
}
$apm_footer_order = '07'
} else {
$apm_footer_order = '06'
}

concat::fragment{ 'datadog apm footer':
target => '/etc/dd-agent/datadog.conf',
content => template('datadog_agent/datadog_apm_footer.conf.erb'),
order => '06',
order => $apm_footer_order,
}


Expand Down
17 changes: 17 additions & 0 deletions spec/classes/datadog_agent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,9 @@
it { should contain_concat__fragment('datadog apm footer').with(
'content' => /^env: foo\n/,
)}
it { should contain_concat__fragment('datadog apm footer').with(
'order' => '06',
)}
end
context 'with service_discovery enabled' do
let(:params) {
Expand All @@ -593,6 +596,20 @@
'content' => /^sd_jmx_enable: true\n/,
)}
end
context 'with extra_template enabled' do
let(:params) {
{:extra_template => 'custom_datadog/extra_template_test.erb',
Copy link
Copy Markdown
Contributor Author

@flyinprogrammer flyinprogrammer Jul 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I added this fixture correctly, I know we ignore this directory in .gitignore, but it seemed like the correct thing to do? Please advise!

Copy link
Copy Markdown
Member

@truthbk truthbk Jul 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be the right thing to do.... it feels like it's the right location, but we'd want to have it outside of the .gitignore blacklist.... that might not be possible though:

from the docs

It is not possible to re-include a file if a parent directory of that file is excluded

We'll have to come up with something I guess.... maybe an alternative location to fixtures 🤔

}}
it { should contain_concat__fragment('datadog extra_template footer').with(
'order' => '06',
)}
it { should contain_concat__fragment('datadog extra_template footer').with(
'content' => /^# extra template is here\n/,
)}
it { should contain_concat__fragment('datadog apm footer').with(
'order' => '07',
)}
end
end
end

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# extra template is here