Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-9397

yum package provider fails when run as non root during noop

    Details

    • Type: Bug
    • Status: Accepted
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: PUP 4.10.0, PUP 5.5.8
    • Fix Version/s: None
    • Component/s: Types and Providers
    • Labels:
      None
    • Template:
      PUP Bug Template
    • Team:
      Platform OS
    • Method Found:
      Needs Assessment
    • QA Risk 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.

        Attachments

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                Unassigned
                Reporter:
                craiggenner Craig Genner
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: