Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
PUP 7.5.0
-
None
-
Night's Watch
-
3
-
NW - 2021-03-31, NW - 2021-04-14
-
Needs Assessment
-
Bug Fix
-
-
Needs Assessment
Description
Puppet Version: 7.0.0 - 7.5.0
Puppet Server Version: PE 2021
OS Name/Version: Windows agents
After the changes done in PUP-10677, the puppet_gem provider is no longer functional on Windows if the PUPPET_DIR environment variable is not present. The variable is set in environment.bat, which we source when executing puppet.bat and the puppet service.
However, if Puppet is used without envionment.bat, or as a library in a ruby file, the variables may not be present. See https://github.com/puppetlabs/puppetlabs-package/blob/main/tasks/init.rb for an example.
Desired Behavior:
Running the package task with the following parameters in PE passes:
Task parameters:
action: install
name: pry
provider: puppet_gem
Actual Behavior:
Running the task fails with the following:
Error: Provider puppet_gem package command is not functional on this host
|
|
{
|
"status" : "failure"
|
}
|
Note that the package task has to be executed through PE/Orchestrator in order to be able to specify the provider parameter. When run on open source installations the task defaults to the powershell implementation which hardcodes choco and does not support setting a custom provider.
Suggestion: Gem.default_bindir provides the path to gem.bat, but we don't have the certainty that puppet is being run with the system ruby or the vendored ruby.
Attachments
Issue Links
- is caused by
-
PUP-10677 Gem provider should install gems on the system ruby on Windows
-
- Resolved
-