diff --git a/manifests/init.pp b/manifests/init.pp index 3b242580..250c7634 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -439,10 +439,11 @@ # Defaults to 30000, using the Jetty default of 30s # # $server_puppetserver_metrics:: Enable puppetserver http-client metrics -# Defaults to false because that's the Puppet Inc. default behaviour. +# Defaults to true, matching defaults in Puppetserver 5+. # # $server_puppetserver_profiler:: Enable JRuby profiling. -# Defaults to false because that's the Puppet Inc. default behaviour. +# Defaults to true, matching defaults in Puppetserver 5+. +# If set to false, compiler and function metrics will not be available, (eg. when enabling graphite metrics) # # $server_metrics_jmx_enable:: Enable or disable JMX metrics reporter. Defaults to true # @@ -707,8 +708,8 @@ Boolean $server_environment_class_cache_enabled = $puppet::params::server_environment_class_cache_enabled, Boolean $server_allow_header_cert_info = $puppet::params::server_allow_header_cert_info, Integer[0] $server_web_idle_timeout = $puppet::params::server_web_idle_timeout, - Boolean $server_puppetserver_metrics = false, - Boolean $server_puppetserver_profiler = false, + Boolean $server_puppetserver_metrics = true, + Boolean $server_puppetserver_profiler = true, Boolean $server_metrics_jmx_enable = $puppet::params::server_metrics_jmx_enable, Boolean $server_metrics_graphite_enable = $puppet::params::server_metrics_graphite_enable, String $server_metrics_graphite_host = $puppet::params::server_metrics_graphite_host, diff --git a/spec/classes/puppet_server_puppetserver_spec.rb b/spec/classes/puppet_server_puppetserver_spec.rb index b22ce935..18ae6182 100644 --- a/spec/classes/puppet_server_puppetserver_spec.rb +++ b/spec/classes/puppet_server_puppetserver_spec.rb @@ -273,7 +273,7 @@ it { should contain_file(puppetserver_conf) .with_content(/^ # Whether to enable http-client metrics; defaults to 'true'.\n metrics-enabled: true$(.*)/) - .with_content(/^profiler: \{\n # enable or disable profiling for the Ruby code;\n enabled: false/) + .with_content(/^profiler: \{\n # enable or disable profiling for the Ruby code;\n enabled: true/) } it { should contain_file('/etc/custom/puppetserver/conf.d/metrics.conf') @@ -292,10 +292,18 @@ it { should contain_file(puppetserver_conf) .with_content(/^ # Whether to enable http-client metrics; defaults to 'true'.\n metrics-enabled: false$/) - .with_content(/^profiler: \{\n # enable or disable profiling for the Ruby code;\n enabled: false/) + .with_content(/^profiler: \{\n # enable or disable profiling for the Ruby code;\n enabled: true/) } it { should contain_file('/etc/custom/puppetserver/conf.d/metrics.conf').with_ensure('file') } end + + context 'when server_profiler => false' do + let(:params) { super().merge(server_puppetserver_profiler: false) } + it { + should contain_file(puppetserver_conf) + .with_content(/^profiler: \{\n # enable or disable profiling for the Ruby code;\n enabled: false/) + } + end end describe 'server_experimental' do