Uploaded image for project: 'Puppet Agent'
  1. Puppet Agent
  2. PA-3248

Puppet should ignore system ruby settings

    XMLWordPrintable

Details

    • Night's Watch
    • 2
    • NW - 2020-05-27, NW - 2020-06-10, NW - 2020-06-24
    • Needs Assessment
    • Bug Fix
    • After this commit, running puppet using wrapper script from puppet-agent package will ignore the following ruby related environment variables: GEM_HOME, GEM_PATH, DLN_LIBRARY_PATH, RUBYLIB, RUBYLIB_PREFIX, RUBYOPT, RUBYPATH, RUBYSHELL
    • Needs Assessment

    Description

      Puppet Version: 5.5.20 and 6.15.0
      Puppet Server Version: N/A
      OS Name/Version: macOSX 10.15.4

      I observe every run puppet emitting warning messages like this:

      $ puppet --version
      Ignoring posix-spawn-0.3.13 because its extensions are not built. Try: gem pristine posix-spawn --version 0.3.13
      Ignoring ruby-augeas-0.5.0 because its extensions are not built. Try: gem pristine ruby-augeas --version 0.5.0
      Ignoring posix-spawn-0.3.13 because its extensions are not built. Try: gem pristine posix-spawn --version 0.3.13
      Ignoring ruby-augeas-0.5.0 because its extensions are not built. Try: gem pristine ruby-augeas --version 0.5.0
      Ignoring posix-spawn-0.3.13 because its extensions are not built. Try: gem pristine posix-spawn --version 0.3.13
      Ignoring ruby-augeas-0.5.0 because its extensions are not built. Try: gem pristine ruby-augeas --version 0.5.0
      6.15.0
      

      Puppet picks up GEM_HOME environment variable, which is used for configuring system ruby, which is different

      $ /opt/puppetlabs/puppet/bin/ruby --version
      ruby 2.5.8p224 (2020-03-31 revision 67882) [x86_64-darwin19]
       
      $ ruby --version
      ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
      

      Desired Behavior:

      Since puppet comes with it's own ruby, system ruby settings should be ignored.

      bolt already handles it properly:

      $ head /opt/puppetlabs/bin/bolt 
      #!/bin/sh
       
       
      # avoid influences from already pre-configured other ruby environments
      env -u GEM_HOME -u GEM_PATH -u DLN_LIBRARY_PATH -u RUBYLIB -u RUBYLIB_PREFIX -u RUBYOPT -u RUBYPATH -u RUBYSHELL -u LD_LIBRARY_PATH -u LD_PRELOAD SHELL=/bin/sh /opt/puppetlabs/bolt/bin/bolt "$@"
      

       

       

      Attachments

        Activity

          People

            ciprian.badescu Ciprian Badescu
            vchepkov Vadym Chepkov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support