sensu / sensu-puppet

Sensu Puppet module.
https://github.com/sensu/sensu-puppet
MIT License
165 stars 290 forks source link

Puppet agent 8 throws a warning when it interpolates the template sensu/agent.yaml.erb #1341

Open maxadamo opened 8 months ago

maxadamo commented 8 months ago

Description of problem

Command used and debugging output

puppet agent -t --debug

Debug: Datacat_collector[sensu_agent_config](provider=datacat_collector): Collected {"backend-url"=>["wss://uat-sensu01.xxxxx.org:8081", "wss://uat-sensu02.xxxxx.org:8081", "wss://uat-sensu03.xxxxx.org:8081"], "name"=>"test-consul01.xxxxx.org", "agent-managed-entity"=>true, "subscriptions"=>["devops_linux", "linux_metrics", "vmware", "devops_linux", "linux_metrics", "vmware"], "annotations"=>{"place"=>"holder", "puppet_board"=>"https://puppetboard.xxxxx.org/test/node/test-consul01.xxxxx.org", "performance_board"=>"https://metrics.xxxxx.org/d/DsGCxmXZz/resources-utilization?orgId=1&var-server_name=test-consul01_xxxxx_org", "What does this server do?"=>"https://wiki.xxxxx.org/dosearchsite.action?cql=siteSearch+~+%22consul%22&queryString=consul"}, "labels"=>{"host_name"=>"test-consul01", "fqdn"=>"test-consul01.xxxxx.org", "ip_address"=>"xxxxxxxxxx", "ip6_address"=>"xxxxxxxxxxx", "reboot_required"=>"false", "security_update_count"=>"0", "domain_password"=>"xxxxxxxxxxxxxxxx", "snmp_community"=>"xxxxxxxxxxxx", "environment"=>"test", "nagios_check_path"=>"/usr/lib/nagios/plugins", "fqdn_metrics_label"=>"test-consul01_xxxxx_org", "os_name"=>"Ubuntu", "os_version"=>"20.04", "hostgroup"=>"consul", "served_domain"=>"consul.xxxxx.org", "memory_limit"=>"-w 85 -c 90", "swap_limit"=>"-w 15% -c 10%"}, "namespace"=>"default", "redact"=>["monitor_password", "domain_password", "password", "passwd", "pass", "api_key", "api_token", "access_key", "secret_key", "private_key", "secret", "snmp_community", "gandi_api_key"], "password"=>"xxxxx", "trusted-ca-file"=>"/etc/sensu/ssl/ca.crt", "statsd-event-handlers"=>["influxdb_stats", "influxdb_sensu_events"], "keepalive-critical-timeout"=>60, "keepalive-warning-timeout"=>40, "keepalive-handlers"=>["devops_email", "it_email", "slack", "squadcast-general"]}
Debug: Datacat_collector[sensu_agent_config](provider=datacat_collector): Applying template sensu/agent.yml.erb
/opt/puppetlabs/puppet/cache/lib/puppet/provider/datacat_collector/datacat_collector.rb:31: warning: Passing safe_level with the 2nd argument of ERB.new is deprecated. Do not use it, and specify other arguments as keyword arguments.
/opt/puppetlabs/puppet/cache/lib/puppet/provider/datacat_collector/datacat_collector.rb:31: warning: Passing trim_mode with the 3rd argument of ERB.new is deprecated. Use keyword argument like ERB.new(str, trim_mode: ...) instead.

Platform and version information

maxadamo commented 22 hours ago

@ManishaKumari295 this issue is caused by datacat module being deprecated: https://forge.puppet.com/modules/richardc/datacat/readme

I can try to fork datacat module and have a look.

maxadamo commented 3 hours ago

@ManishaKumari295 a possible solution consists of switching from datacat module to puppet-colections module, hence switching from ERB to EPP.

Could you also please revert the change below? This default value is not appropriate for a public module:

Optional[Stdlib::Absolutepath] $package_download_path = '/home/ubuntu/.puppetlabs/etc/code/modules',