fix: make puppetdb_query function available in built images#160
Open
bootc wants to merge 1 commit into
Open
Conversation
Colocate the puppetdb termini with the openvox gem lib so Puppet's Pops system loader finds puppetdb_query during compilation. Since OpenVoxProject#141 the images gem-install openvox instead of using the OS packages, so the termini in vendor_ruby are no longer on the loader's root. Fixes OpenVoxProject#159. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Chris Boot <bootc@boo.tc>
bastelfreak
reviewed
Jun 29, 2026
| # rather than ruby-load-path. Since #141 gem-installs openvox instead of using | ||
| # the OS packages (whose openvoxdb-termini colocated everything in vendor_ruby), | ||
| # that root is the gem lib, so puppetdb_query would otherwise be unknown. | ||
| cp -r /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet \ |
Contributor
There was a problem hiding this comment.
I don't know if this is a goood idea or if we should adjust the load path. Every openvox-server I know has this in /etc/puppetlabs/puppetserver/conf.d/puppetserver.conf:
gem-path: [${jruby-puppet.gem-home}, "/opt/puppetlabs/server/data/puppetserver/vendored-jruby-gems", "/opt/puppetlabs/puppet/lib/ruby/vendor_gems"]
https://github.com/theforeman/puppet-puppet/blob/master/manifests/server/puppetserver.pp#L211
Contributor
There was a problem hiding this comment.
Ahhh it's /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet vs /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet 🤔
Member
Author
There was a problem hiding this comment.
This one does too!
However as my AI worked out, Ruby functions aren't loaded from the gem path so it doesn't find them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Short description
Fixes #159:
puppetdb_queryfails withUnknown function: 'puppetdb_query'during catalog compilation in built images, even though the PuppetDB termini are installed.The termini are installed in
vendor_ruby(onruby-load-path), which covers therequire-loaded indirector terminus and report processor — so storeconfigs and reports work. But Puppet 4 functions load via the Pops system loader, which is rooted at puppet's own lib dir, notruby-load-path. Since #141 the images gem-installopenvoxinstead of installing the OS packages (whoseopenvoxdb-terminideb colocated the termini with the vendored puppet invendor_ruby), so that root is now the gem's lib dir and the termini'spuppet/functions/is off the search path.This colocates the termini
puppet/tree with the openvox gem lib, restoring the layout the OS packages relied on. The filenames don't collide with openvox's own.See #159 for the full analysis and an alternative (shipping the termini as a module on
basemodulepath).Checklist
I have:
Signed-off-byannotation to each of my commits🤖 Generated with Claude Code