Skip to content

Commit

Permalink
[agent6] fix hostname override tag support (DataDog#445)
Browse files Browse the repository at this point in the history
  • Loading branch information
truthbk authored Jul 10, 2018
1 parent ee59a16 commit 5e5f44c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,7 @@
$_agent_config = {
'api_key' => $api_key,
'dd_url' => $dd_url,
'hostname' => $host,
'cmd_port' => 5001,
'conf_path' => $datadog_agent::params::conf6_dir,
'enable_metadata_collection' => $collect_instance_metadata,
Expand Down
13 changes: 12 additions & 1 deletion spec/classes/datadog_agent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,18 @@
end
end

context 'with apm_extra_config' do
context 'with modified defaults' do
context 'hostname override' do
let(:params) {{
:host => 'my_custom_hostname',
}}
it { should contain_file('/etc/datadog-agent/datadog.yaml').with(
'content' => /^hostname: my_custom_hostname\n/,
)}
end
end

context 'with additional agents config' do
context 'with extra_options and APM enabled' do
let(:params) {{
:apm_enabled => true,
Expand Down

0 comments on commit 5e5f44c

Please sign in to comment.