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

Gem provider should allow alternative gem command; should not rely on $PATH

    XMLWordPrintable

Details

    • Night's Watch
    • PR - 2019-04-17, PR - 2019-05-02, PR - 2019-05-15
    • 33048,40158
    • 2
    • New Feature
    • Hide
      Package providers now support a targeted package management command

      Puppet package providers use `which` to find the first package management command (for example: `gem` for Ruby, `pip` for Python) in the `PATH`. That prevented Puppet from managing other installations of the same software.

      This release adds a `targetable` feature to the Package type, allowing Package providers to implement a `command` attribute. The gem and pip providers now implement that attribute.

      ```
      package { 'colorize':
        name => 'colorize',
        provider => gem,
      }

      package { 'colorize-opt':
        name => 'colorize',
        provider => gem,
        command => '/opt/ruby/bin/gem',
      }
      ```

      This feature allows Puppet to manages the packages in software collections (multiple versions of the same software) such as Red Hat Software Collections.

      PUP-1082, PUP-6488
      Show
      Package providers now support a targeted package management command Puppet package providers use `which` to find the first package management command (for example: `gem` for Ruby, `pip` for Python) in the `PATH`. That prevented Puppet from managing other installations of the same software. This release adds a `targetable` feature to the Package type, allowing Package providers to implement a `command` attribute. The gem and pip providers now implement that attribute. ``` package { 'colorize':   name => 'colorize',   provider => gem, } package { 'colorize-opt':   name => 'colorize',   provider => gem,   command => '/opt/ruby/bin/gem', } ``` This feature allows Puppet to manages the packages in software collections (multiple versions of the same software) such as Red Hat Software Collections. PUP-1082 , PUP-6488

    Description

      In PUP-5427, mi commented:

      1. The gem-provider should not rely on the $PATH for the default gem – it must explicitly invoke the gem-executable appropriate for the underlying OS. On Linux that's /usr/bin/gem, on FreeBSD that's typically /usr/local/bin/gem and so on.
      2. The gem-provider must allow specifying an alternative gemcmd. People have been asking for this for years. Something like:

          package {'foo':
            ensure   => 'latest',
            provider => 'gem',
            gemcmd   => '/usr/local/bin/gem22'
          }
        

        ought to work. But does not...

      Attachments

        Issue Links

          Activity

            People

              sebastian.miclea Sebastian Miclea
              geoff.nichols Geoff Nichols
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support