Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate Puppet gem shim approach #308

Open
seanmil opened this issue Feb 11, 2025 · 0 comments
Open

Investigate Puppet gem shim approach #308

seanmil opened this issue Feb 11, 2025 · 0 comments

Comments

@seanmil
Copy link

seanmil commented Feb 11, 2025

The puppet gem is depended upon by a number of tools / gems, both publicly published and internal to organizations.

With the new landscape consisting of multiple Puppet implementations, there needs to be a way for gems requiring access to the Puppet API to depend on a single gem which can provide the required functionality regardless of which Puppet-compatible implementation is used.

I propose creation of a new gem (for example's sake, let's say "puppet_picker"). puppet_picker would be a fairly simple shim gem that would either auto-select a Puppet-compatible implementation found or allow the use to specify which one to use (if there are multiple installed at once to choose from). Tools would then need to switch their dependencies from puppet to puppet_picker.

The manual selection could be done via a configuration file (e.g. /etc/puppet_picker.conf) with syntax like:

---
implementation: '<puppet implementation>'

or via an environment variable such as PUPPET_PICKER=<puppet implementation>

Then, when require 'puppet_picker' is invoked it might look something like:

module PuppetPicker
  impl = $ENV['PUPPET_PICKER']
  require impl

  klass = convert_impl_to_ruby_class(impl)
  klass.activate_implementation
end

where the klass.activate_implementation might contain code to assign the implementation's Ruby module/class namespace constants to the Puppet namespace constants.

This is all as of yet untested and unimplemented, but might be one way of solving the "Puppet gem problem".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

1 participant