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

use puppetserver_gem when installing on JVM puppetserver #2

Closed
danieldreier opened this issue Oct 27, 2015 · 3 comments
Closed

use puppetserver_gem when installing on JVM puppetserver #2

danieldreier opened this issue Oct 27, 2015 · 3 comments

Comments

@danieldreier
Copy link
Owner

as-is, the autosign module is not usable on JVM puppetserver without additional code because puppetserver gems must be installed using puppetserver_gem, not the normal gem package provider.

@willtome
Copy link
Contributor

willtome commented Sep 27, 2016

This was one thing I was trying to address with #8. I finally got some time to redeploy that code from scratch on a JVM puppetserver. I believe that there is more that needs to be addressed than just the gem provider.

The gem is needed with puppetserver_gem for the generate token function to work. However, when installing the with puppetserver_gem, the validator scripts were placed in /opt/puppetlabs/server/data/puppetserver/jruby-gems/bin/autosign-validator. If this was set as the validator script for autosign in puppet.conf it would fail to run the script to validate a node.

My bandaid solution was to install the gem with both puppet_gem and puppetserver_gem. When compiling, the token is generated with the puppetserver_gem package and the validator script located /opt/puppetlabs/puppet/bin/autosign-validator uses the puppet_gem package. This seems to work but I don't love having to install the gem twice. There may not be a way around it but I thought I'd throw it out there if anyone has any feedback.

@danieldreier
Copy link
Owner Author

I think the approach we ought to take here is to write puppet code that installs the gem via both providers, but I'm not sure how to do that; I think there'd be a resource conflict. We could use an exec as a hack, but that feels pretty gross. Maybe less gross than having to do it manually, though.

genebean added a commit to genebean/puppet-autosign that referenced this issue Oct 24, 2017
@logicminds
Copy link
Collaborator

When trying to install via puppetserver_gem I get

[root@pe-xl-core-0 /]# /opt/puppetlabs/bin/puppetserver gem install autosign
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.headius.backport9.modules.Modules (file:/opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar) to field java.io.FileDescriptor.fd
WARNING: Please consider reporting this to the maintainers of com.headius.backport9.modules.Modules
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
NotImplementedError: flock unsupported or native support failed to load; see https://github.com/jruby/jruby/wiki/Native-Libraries
                   flock at org/jruby/RubyFile.java:323
             read_binary at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems.rb:890
                    open at org/jruby/RubyIO.java:1158
             read_binary at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems.rb:889
              fetch_spec at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/source.rb:150
                    spec at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/resolver/api_specification.rb:77
      add_always_install at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/resolver/installer_set.rb:79
    resolve_dependencies at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/dependency_installer.rb:480
             install_gem at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/commands/install_command.rb:201
            install_gems at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/commands/install_command.rb:262
                    each at org/jruby/RubyArray.java:1800
            install_gems at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/commands/install_command.rb:258
                 execute at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/commands/install_command.rb:165
  invoke_with_build_args at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/command.rb:313
            process_args at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/command_manager.rb:173
                     run at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/command_manager.rb:143
                     run at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/gem_runner.rb:59
                  <main> at /opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar!/META-INF/jruby.home/bin/jgem:21
                    load at org/jruby/RubyKernel.java:1022
                  <main> at /opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar!/META-INF/jruby.home/bin/gem:1
                    load at org/jruby/RubyKernel.java:1022
                  <main> at -e:1

logicminds added a commit to nwops/puppet-autosign that referenced this issue May 14, 2020
logicminds added a commit that referenced this issue May 14, 2020
Fixes #2 - use puppetserver_gem when installing on JVM puppetserver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants