Open ripienaar opened 6 years ago
This is already vaguely covered in:
The operating environment the task is executed in (such as environment variables set and user privilege) is also controlled by the task runner. Task authors should document any requirements they have.
Not sure how that guidance would have avoided this issue
At present there is no mention of what should and should not be in the PATH for tasks to rely on, the Apache task has this:
https://github.com/puppetlabs/puppetlabs-apache/blob/e587f2af793111adab04bb776808f99a09ca092b/tasks/init.rb#L8
Here it relies on
facter
being in the path which only works in PE because apparently PE linksfacter
to/usr/local/bin
- somethingpuppet-agent
does not do.It probably works under ssh bolt because that reads the profile files that may or may not exist on the node
It all kind of seems to work by accident rather than clear specification.
A quick chat on Slack about this suggested that probably tasks should not expect PATH to have anything and should use full paths for most things like here:
https://github.com/puppetlabs/puppetlabs-facter_task/blob/32658a05a6080c35505267184b9a14a1ef6d8768/tasks/init.rb#L21