Project

General

Profile

Bug #14941

Puppet RUBYLIB set to incorrect modules directory on Debian, errors under AIO

Added by Dominic Cleal over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Difficulty:
Triaged:
No
Bugzilla link:

Description

When running on Debian, the RUBYLIB that Puppet's run under is incorrect - the modules/ dir doesn't exist at that path.

[DEBUG 2016-05-06 07:40:47 main] echo '$kafo_config_file="/etc/foreman-installer/scenarios.d/foreman.yaml"  $kafo_add_progress=true include kafo_configure' | RUBYLIB=/usr/lib/ruby/vendor_ruby/kafo/../..//modules: /opt/puppetlabs/bin/puppet apply --verbose --debug --trace
 --color=false --show_diff --detailed-exitcodes --modulepath /usr/share/foreman-installer/modules:/usr/lib/ruby/vendor_ruby/kafo/modules 

/usr/lib/ruby/vendor_ruby/kafo/../..//modules resolves to /usr/lib/ruby/modules, but should be /usr/lib/ruby/vendor_ruby/kafo/modules. On an RPM installation it's set to /usr/share/gems/gems/kafo-0.8.0/lib/kafo/../..//modules, which resolves OK.

This results in some errors loading other functions from bits of the modulepath when using an AIO Puppet agent, as it's running in a different Ruby environment:

[ERROR 2016-05-06 07:40:52 main]  Evaluation Error: Error while evaluating a Function Call, Could not autoload puppet/parser/functions/add_progress: cannot load such file -- kafo/modules/kafo_configure/lib/kafo/puppet/report_wrapper at /usr/lib/ruby/vendor_ruby/kafo/modules/kafo_configure/manifests/init.pp:10:5 on node foremandeb.example.com
[ INFO 2016-05-06 07:40:52 main] /opt/puppetlabs/puppet/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
[ INFO 2016-05-06 07:40:52 main] /opt/puppetlabs/puppet/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
[ INFO 2016-05-06 07:40:52 main] /usr/lib/ruby/vendor_ruby/kafo/modules/kafo_configure/lib/puppet/parser/functions/add_progress.rb:1:in `<top (required)>'

Note the error's slightly different as the ruby-kafo package contains a patch that requires kafo/modules/kafo_configure/lib/kafo/puppet/report_wrapper rather than kafo_configure/lib/kafo/puppet/report_wrapper from add_progress.rb. This assumes Puppet is in the same Ruby environment as the Kafo installation. The latter, original path should work if RUBYLIB was set to the modules/ path correctly.


There's also a second error loading kafo/password_manager, but this is due to a patch in the Debian package which I'll fix there.

[ERROR 2016-05-06 07:51:36 main]  Evaluation Error: Error while evaluating a Function Call, Could not autoload puppet/parser/functions/load_kafo_password: cannot load such file -- kafo/password_manager at /usr/lib/ruby/vendor_ruby/kafo/modules/kafo_configure/manifests/init.pp:13:15 on node foremandeb.example.com
[ INFO 2016-05-06 07:51:36 main] /opt/puppetlabs/puppet/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
[ INFO 2016-05-06 07:51:36 main] /opt/puppetlabs/puppet/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
[ INFO 2016-05-06 07:51:36 main] /usr/lib/ruby/vendor_ruby/kafo/modules/kafo_configure/lib/puppet/parser/functions/decrypt.rb:1:in `<top (required)>'
[ INFO 2016-05-06 07:51:36 main] /opt/puppetlabs/puppet/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
[ INFO 2016-05-06 07:51:36 main] /opt/puppetlabs/puppet/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
[ INFO 2016-05-06 07:51:36 main] /usr/lib/ruby/vendor_ruby/kafo/modules/kafo_configure/lib/puppet/parser/functions/load_kafo_password.rb:6:in `<top (required)>'

It assumes kafo and Puppet are in the same Ruby installation, but could load the file relatively.


Related issues

Blocks Foreman - Tracker #8447: Puppet 4 supportClosed2014-11-19

Associated revisions

Revision 5b88f829 (diff)
Added by Dominic Cleal over 5 years ago

fixes #14941 - set Puppet RUBYLIB from kafo_modules_dir config (#150)

History

#1 Updated by The Foreman Bot over 5 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/kafo/pull/150 added

#2 Updated by The Foreman Bot over 5 years ago

  • Pull request https://github.com/theforeman/foreman-packaging/pull/1127 added

#3 Updated by Dominic Cleal over 5 years ago

#4 Updated by Dominic Cleal over 5 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF