You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Affected Puppet, Ruby, OS and module versions/distributions
Puppet: 4.10.8
Ruby:2.0.0p648 (2015-12-16) [x86_64-linux] (that's the system ruby)
Distribution: CentOS Linux release 7.4.1708 (Core)
Module version: 3.1.0
How to reproduce (e.g Puppet code you use)
Using a puppet master/agent architecture
Install the puppet/prometheus module on the master
Run puppet agent on an agent node as part of a service, e.g. systemd service
As soon as he prometheus module is installed in an environment he custom fact will be collected on master and agents, triggering the bug.
What are you seeing
When attempting to collect the custom prometheus_alert_manager_running fact an error occurs:
(Facter) error while resolving custom fact "prometheus_alert_manager_running": execution of command "puppet resource service alert_manager 2>&1" failed: command not found.
What behaviour did you expect instead
No error - fact collected as normal.
Output log
see above
Any additional information you'd like to impart
I think this error is down to the fact that puppet is not in the PATH when puppet runs as part of the service. The default systemd service file that comes with the puppetlabs collections does not insert /opt/puppetlabs/bin into the PATH of the service file.
In contrast, the same collection does add a drop-in at /etc/profile.d/ to ensure login-shells do have puppet in the path (so running the command from the fact from a login shell works fine).
I would suggest the fix is to put in the full path of the puppet binary into the fact - ideally there's some way of fetching that inside Facter.
The text was updated successfully, but these errors were encountered:
Affected Puppet, Ruby, OS and module versions/distributions
How to reproduce (e.g Puppet code you use)
Using a puppet master/agent architecture
As soon as he prometheus module is installed in an environment he custom fact will be collected on master and agents, triggering the bug.
What are you seeing
When attempting to collect the custom
prometheus_alert_manager_running
fact an error occurs:What behaviour did you expect instead
No error - fact collected as normal.
Output log
see above
Any additional information you'd like to impart
I think this error is down to the fact that
puppet
is not in thePATH
when puppet runs as part of the service. The defaultsystemd
service file that comes with the puppetlabs collections does not insert/opt/puppetlabs/bin
into thePATH
of the service file.In contrast, the same collection does add a drop-in at
/etc/profile.d/
to ensure login-shells do havepuppet
in the path (so running the command from the fact from a login shell works fine).I would suggest the fix is to put in the full path of the
puppet
binary into the fact - ideally there's some way of fetching that insideFacter
.The text was updated successfully, but these errors were encountered: