From 09c32b88fab31e7d93a2111f03617cb2ee45bc89 Mon Sep 17 00:00:00 2001 From: Jeff Frost Date: Tue, 22 Aug 2017 13:13:06 -0700 Subject: [PATCH 1/2] Add support for process_agent_enabled Process agent is in closed beta currently, but this will add support to the puppet module. --- manifests/init.pp | 5 +++++ spec/classes/datadog_agent_spec.rb | 10 ++++++++++ templates/datadog_footer.conf.erb | 4 ++++ 3 files changed, 19 insertions(+) diff --git a/manifests/init.pp b/manifests/init.pp index 26febfe5..0f5479f2 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -157,6 +157,9 @@ # $apm_env # String defining the environment for the APM traces # String. Default: empty +# $process_agent_enabled +# Boolean to enable the process/container agent +# Boolean. Default: false # # Actions: # @@ -248,6 +251,7 @@ $dd_group = $datadog_agent::params::dd_group, $apm_enabled = false, $apm_env = '', + $process_agent_enabled = false, ) inherits datadog_agent::params { # Allow ports to be passed as integers or strings. @@ -321,6 +325,7 @@ validate_string($consul_token) validate_bool($apm_enabled) validate_string($apm_env) + validate_bool($process_agent_enabled) if $hiera_tags { $local_tags = hiera_array('datadog_agent::tags', []) diff --git a/spec/classes/datadog_agent_spec.rb b/spec/classes/datadog_agent_spec.rb index 8c0e5780..0ed41045 100644 --- a/spec/classes/datadog_agent_spec.rb +++ b/spec/classes/datadog_agent_spec.rb @@ -210,6 +210,7 @@ 'content' => /^apm_enabled: false\n/, )} end + end context 'with user provided paramaters' do @@ -610,6 +611,15 @@ 'order' => '07', )} end + context 'with process_agent enabled' do + let(:params) { + {:process_agent_enabled => true, + }} + it { should contain_concat__fragment('datadog footer').with( + 'content' => /^process_agent_enabled: true\n/, + )} + end + end end diff --git a/templates/datadog_footer.conf.erb b/templates/datadog_footer.conf.erb index f418c0c3..6b6deaba 100644 --- a/templates/datadog_footer.conf.erb +++ b/templates/datadog_footer.conf.erb @@ -336,6 +336,10 @@ sd_jmx_enable: <%= @sd_jmx_enable %> consul_token: <%= @consul_token %> <% end -%> +<% if @process_agent_enabled -%> +process_agent_enabled: <%= @process_agent_enabled %> +<% end -%> + # ========================================================================== # # Trace # # ========================================================================== # From 2e8f2bf2c3d78ce5c3b897bd494d25bbc09ff597 Mon Sep 17 00:00:00 2001 From: Jeff Frost Date: Tue, 22 Aug 2017 13:14:49 -0700 Subject: [PATCH 2/2] Fix https://github.com/DataDog/puppet-datadog-agent/issues/349 --- manifests/integrations/jmx.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/integrations/jmx.pp b/manifests/integrations/jmx.pp index 038a7a97..64cff15f 100644 --- a/manifests/integrations/jmx.pp +++ b/manifests/integrations/jmx.pp @@ -22,7 +22,7 @@ # The JMX port. # jmx_url: # If the agent needs to connect to a non-default JMX URL, specify it here -# instead of a host and a port. If you use this you need to specify a ‘name’ +# instead of a host and a port. If you use this you need to specify a 'name' # for the instance. Optional. # user: # The username for connecting to the running JVM. Optional.