diff --git a/manifests/init.pp b/manifests/init.pp index 25b788f0..ede2c627 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -552,7 +552,7 @@ # lint:endignore $base_extra_config = { 'apm_config' => { - 'apm_enabled' => $apm_enabled, + 'enabled' => $apm_enabled, 'env' => $apm_env, 'apm_non_local_traffic' => $apm_non_local_traffic }, diff --git a/spec/classes/datadog_agent_spec.rb b/spec/classes/datadog_agent_spec.rb index fad86694..e6055e84 100644 --- a/spec/classes/datadog_agent_spec.rb +++ b/spec/classes/datadog_agent_spec.rb @@ -899,7 +899,7 @@ 'content' => /^apm_config:\n/, )} it { should contain_file('/etc/datadog-agent/datadog.yaml').with( - 'content' => /^\ \ apm_enabled: false\n/, + 'content' => /^apm_config:\n\ \ enabled: false\n/, )} it { should contain_file('/etc/datadog-agent/datadog.yaml').with( 'content' => /^\ \ apm_non_local_traffic: false\n/, @@ -908,7 +908,7 @@ 'content' => /^process_config:\n/, )} it { should contain_file('/etc/datadog-agent/datadog.yaml').with( - 'content' => /^\ \ enabled: disabled\n/, + 'content' => /^process_config:\n\ \ enabled: disabled\n/, )} it { should contain_file('/etc/datadog-agent/datadog.yaml').with( 'content' => /^\ \ scrub_args: true\n/, @@ -1017,7 +1017,7 @@ 'content' => /^apm_config:\n/, )} it { should contain_file('/etc/datadog-agent/datadog.yaml').with( - 'content' => /^\ \ apm_enabled: true\n/, + 'content' => /^apm_config:\n\ \ enabled: true\n/, )} it { should contain_file('/etc/datadog-agent/datadog.yaml').with( 'content' => /^\ \ foo: bar\n/, @@ -1026,7 +1026,7 @@ 'content' => /^\ \ bar: haz\n/, )} end - + context 'with APM non local traffic enabled' do let(:params) {{ :apm_enabled => true, @@ -1037,7 +1037,7 @@ 'content' => /^apm_config:\n/, )} it { should contain_file('/etc/datadog-agent/datadog.yaml').with( - 'content' => /^\ \ apm_enabled: true\n/, + 'content' => /^apm_config:\n\ \ enabled: true\n/, )} it { should contain_file('/etc/datadog-agent/datadog.yaml').with( 'content' => /^\ \ apm_non_local_traffic: true\n/, @@ -1058,13 +1058,13 @@ 'content' => /^apm_config:\n/, )} it { should contain_file('/etc/datadog-agent/datadog.yaml').with( - 'content' => /^\ \ apm_enabled: false\n/, + 'content' => /^apm_config:\n\ \ enabled: false\n/, )} it { should contain_file('/etc/datadog-agent/datadog.yaml').with( 'content' => /^process_config:\n/, )} it { should contain_file('/etc/datadog-agent/datadog.yaml').with( - 'content' => /^\ \ enabled: 'true'\n/, + 'content' => /^process_config:\n\ \ enabled: 'true'\n/, )} it { should contain_file('/etc/datadog-agent/datadog.yaml').with( 'content' => /^\ \ foo: bar\n/, @@ -1088,7 +1088,7 @@ 'content' => /^process_config:\n/, )} it { should contain_file('/etc/datadog-agent/datadog.yaml').with( - 'content' => /^\ \ enabled: disabled\n/, + 'content' => /^process_config:\n\ \ enabled: disabled\n/, )} it { should contain_file('/etc/datadog-agent/datadog.yaml').with( 'content' => /^\ \ foo: bar\n/, @@ -1109,7 +1109,7 @@ 'content' => /^process_config:\n/, )} it { should contain_file('/etc/datadog-agent/datadog.yaml').with( - 'content' => /^\ \ enabled: 'true'\n/, + 'content' => /^process_config:\n\ \ enabled: 'true'\n/, )} it { should contain_file('/etc/datadog-agent/datadog.yaml').with( 'content' => /^\ \ scrub_args: false\n/, @@ -1128,7 +1128,7 @@ 'content' => /^process_config:\n/, )} it { should contain_file('/etc/datadog-agent/datadog.yaml').with( - 'content' => /^\ \ enabled: 'true'\n/, + 'content' => /^process_config:\n\ \ enabled: 'true'\n/, )} it { should contain_file('/etc/datadog-agent/datadog.yaml').with( 'content' => /^\ \ scrub_args: true\n/,