From 8091740cb6cebe77bfab1e0295b40dc65d450bdc Mon Sep 17 00:00:00 2001 From: William Bradford Clark Date: Thu, 6 Oct 2022 15:06:26 -0400 Subject: [PATCH] Fixes #35607 - Configure Pulpcore's TELEMETRY setting --- manifests/init.pp | 7 +++++++ templates/settings.py.erb | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/manifests/init.pp b/manifests/init.pp index e9187724..eee58dba 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -174,6 +174,12 @@ # @param loggers # Configure additional loggers or override pre-defined logger configuration. # +# @param telemetry +# Configure TELEMETRY in settings.yml, which controls the reporting of anonymous data to https://analytics.pulpproject.org/, +# starting with Pulpcore version 3.21.0, to guide Pulp project developers. Set this to false to opt out of this anonymous reporting; +# if undef, it will instead be omitted from settings.yml and Pulp will report these usage statistics per its default behavior. +# Adding this configuration will have no effect in Pulp versions prior to the introduction of the telemetry feature. +# # @example Default configuration # include pulpcore # @@ -228,6 +234,7 @@ Optional[Variant[Integer[1], Enum['None']]] $cache_expires_ttl = undef, Pulpcore::LogLevel $log_level = 'INFO', Hash[String[1], Pulpcore::Logger] $loggers = {}, + Optional[Boolean] $telemetry = undef, ) { $settings_file = "${config_dir}/settings.py" $certs_dir = "${config_dir}/certs" diff --git a/templates/settings.py.erb b/templates/settings.py.erb index bd8be52d..10eaf4c7 100644 --- a/templates/settings.py.erb +++ b/templates/settings.py.erb @@ -8,6 +8,15 @@ # configuration. ################################################################################ +# Send anonymous usage data to https://analytics.pulpproject.org/ unless this is +# explicitly defined with value False. This data is used by the Pulp project +# to make informed, data-driven decisions about future feature development. +<% if scope['pulpcore::telemetry'].nil? -%> +# TELEMETRY = False +<% else -%> +TELEMETRY = <%= scope['pulpcore::telemetry'] %> +<% end -%> + CONTENT_HOST = "<%= scope['pulpcore::servername'] %>" CONTENT_ORIGIN = "https://<%= scope['pulpcore::servername'] %>" SECRET_KEY = "<%= scope['pulpcore::django_secret_key'] %>"