ansible icon indicating copy to clipboard operation
ansible copied to clipboard

smartctl exporter role: the default user and group should be root

Open kennethso168 opened this issue 1 year ago • 1 comments

Just tried out the smartctl exporter role without further configuration and it didn't work. It works after setting smartctl_exporter_system_user and smartctl_exporter_system_group to root.

From https://github.com/prometheus-community/smartctl_exporter/issues/146, the upstream package is intended to be run as root, and the provided SystemD unit files in the upstream package are configured to have root as the user as well. There is some extra steps required in order to allow non-root users to run the exporter.

Therefore, I would suggest changing the defaults to smartctl_exporter_system_user and smartctl_exporter_system_group to root for a better out-of-the-box experience

kennethso168 avatar Feb 21 '24 10:02 kennethso168

Good point! I like the systemd unit in the AUR package, perhaps we should base the one in the role on that.

With that being said, we should absolutely try to catch issues like this in the molecule tests.

gardar avatar Feb 23 '24 14:02 gardar