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

Unable to install Ruby gem on Windows with ensure and version range

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Accepted
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: PUP 5.5.21
    • Fix Version/s: None
    • Component/s: Types and Providers
    • Labels:
      None
    • Template:
      PUP Bug Template
    • Agent OS:
      Windows Server 2012 R2 (x64)
    • Story Points:
      2
    • Sprint:
      NW - 2020-10-14
    • Method Found:
      Needs Assessment
    • QA Risk Assessment:
      Needs Assessment

      Description

      Puppet Version: 5.5.21
      Puppet Server Version: n/a
      OS Name/Version: Windows 2012R2

      The following example on Windows doesn't work:

       

      package { 'sensu-plugins-puppet':
        ensure   => '>= 2.2.0',
        provider => gem,
        command  => 'C:\\opt\\sensu\\embedded\\bin\\gem.cmd',
      }
      

      (This would normally be using the sensuclassic_gem provider which essentially just sets command for you, I've reproduced it just using the core Puppet provider for simplicity).

       

      This works on Linux fine (with an adjusted command).

      Desired Behavior:

      The package should be installed honouring the ensure value like it does on Linux.

      Actual Behavior:

       

       

      Error: Could not update: Execution of 'C:\opt\sensu\embedded\bin\gem.cmd install -v ">= 2.2.0" --no-document sensu-plugins-puppet' returned 1: The filename, directory name, or volume label syntax is incorrect.
      Error: /Stage[main]/Main/Package[sensu-plugins-puppet]/ensure: change from 'absent' to '>= 2.2.0' failed: Could not update: Execution of 'C:\opt\sensu\embedded\bin\gem.cmd install -v ">= 2.2.0" --no-document sensu-plugins-puppet' returned 1:
      The filename, directory name, or volume label syntax is incorrect.

       

      If I change the ensure to just a specific version or 'present', etc. it works. If I run the command manually, it also works so it suggests something to do with the way Puppet is constructing the command internally on Windows, my hunch is the ">= 2.2.0" is causing the trouble.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            bodgit Matt Dainty
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:

                Zendesk Support