voxpupuli / puppet-telegraf

A Puppet module for installing and configuring InfluxData's Telegraf
https://forge.puppet.com/puppet/telegraf
GNU General Public License v3.0
24 stars 98 forks source link

telegraf user on debian now has _ #200

Open robkooper opened 1 year ago

robkooper commented 1 year ago

Affected Puppet, Ruby, OS and module versions/distributions

How to reproduce (e.g Puppet code you use)

On clean install of ubuntu 22.04 install telegraf. Previously the user would be telegraf however it seems that the new policy for debian is to have service accounts start with a _. This will break the username used to change permisions (at https://github.com/voxpupuli/puppet-telegraf/blob/master/manifests/params.pp#L89).

What are you seeing

Puppet throws an error on new machines when it tries to install telegraf:

Feb 24 2023 - 14:09:52 Puppet err Could not find user telegraf  
Feb 24 2023 - 14:09:52 /Stage[main]/Telegraf::Config/File[/etc/telegraf/telegraf.conf]/owner err, file, class, telegraf::config, telegraf, config, profile::base, profile, base, node, default change from 'root' to 'telegraf' failed: Could not find user telegraf /etc/puppetlabs/code/environments/production/modules/telegraf/manifests/config.pp:8
Feb 24 2023 - 14:09:52 Puppet err Could not find group telegraf  
Feb 24 2023 - 14:09:52 /Stage[main]/Telegraf::Config/File[/etc/telegraf/telegraf.conf]/group err, file, class, telegraf::config, telegraf, config, profile::base, profile, base, node, default change from 'root' to 'telegraf' failed: Could not find group telegraf /etc/puppetlabs/code/environments/production/modules/telegraf/manifests/config.pp:8
Feb 24 2023 - 14:09:52 Puppet err Could not find user telegraf  
Feb 24 2023 - 14:09:52 /Stage[main]/Telegraf::Config/File[/etc/telegraf/telegraf.d]/owner err, file, class, telegraf::config, telegraf, config, profile::base, profile, base, node, default change from 'root' to 'telegraf' failed: Could not find user telegraf /etc/puppetlabs/code/environments/production/modules/telegraf/manifests/config.pp:21
Feb 24 2023 - 14:09:52 Puppet err Could not find group telegraf  
Feb 24 2023 - 14:09:52 /Stage[main]/Telegraf::Config/File[/etc/telegraf/telegraf.d]/group err, file, class, telegraf::config, telegraf, config, profile::base, profile, base, node, default change from 'root' to 'telegraf' failed: Could not find group telegraf /etc/puppetlabs/code/environments/production/modules/telegraf/manifests/config.pp:21

What behaviour did you expect instead

if would be nice if it had an exec to look up the actual user in case of debian, and store this as a fact.

Output log

Any additional information you'd like to impart