Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Won't Fix
-
PUP 4.10.0, PUP 5.5.8
-
None
-
Night's Watch
-
Needs Assessment
-
Needs Assessment
Description
Puppet Version: 5.5.8
Puppet Server Version: NA
OS Name/Version: CentOS 6 & 7
When running a puppet apply in `noop` mode as a non root user, the catalog fails to apply and errors "The yum provider can only be used as root".
This is due to `lib/puppet/provider/package/yum.rb` line 29 where the package prefix errors if the apply is not done as root.
Desired Behavior:
$ puppet apply --noop -e 'package { "moreutils": ensure => installed}'
Notice: Compiled catalog for centos7.localdomain in environment production in 1.35 seconds
Notice: /Stage[main]/Main/Package[moreutils]/ensure: current_value purged, should be present (noop)
Notice: Class[Main]: Would have triggered 'refresh' from 1 events
Notice: Stage[main]: Would have triggered 'refresh' from 1 events
Notice: Applied catalog in 0.27 seconds
Actual Behavior:
$ puppet apply --noop -e 'package { "moreutils": ensure => installed}'
Notice: Compiled catalog for centos7.localdomain in environment production in 1.27 seconds
Error: Failed to apply catalog: The yum provider can only be used as root
It appears that the raising of the error does not take into account running in `noop` mode, I've tried to find out how to fix this but I;m not familiar enough with the puppet code.