Bug #14941
closedPuppet RUBYLIB set to incorrect modules directory on Debian, errors under AIO
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.
Updated by The Foreman Bot over 8 years ago
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/kafo/pull/150 added
Updated by The Foreman Bot over 8 years ago
- Pull request https://github.com/theforeman/foreman-packaging/pull/1127 added
Updated by Dominic Cleal over 8 years ago
- Blocks Tracker #8447: Puppet 4 support added
Updated by Dominic Cleal over 8 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 5b88f829f73399fc190e3b1e41a34f1f779371d0.