jruby / activerecord-jdbc-adapter

JRuby's ActiveRecord adapter using JDBC.
BSD 2-Clause "Simplified" License
462 stars 385 forks source link

require 'activerecord-jdbc-adapter' seemes like crash Puppet7 server #1135

Open bimax opened 1 year ago

bimax commented 1 year ago

My setup: Puppet Server 7.9.2 on JRuby (as a standard). Puppet Agent 7.20.0 sqlite3 database as a source of infrastructure for configuration data

Custom function brakes puppet server (in a way I'll describe below):

require 'activerecord-jdbc-adapter'

#Documentation
Puppet::Functions.create_function(:brakepuppet) do
  dispatch :brakepuppet do
    required_param 'String', :print_text
  end

  def brakepuppet(print_text)
    return $print_text
  end
end

if I comment require 'activerecord-jdbc-adapter' - everything works at it should be.

Puppet manifest looks like:

info("This is DEBUG")

file {
    default:
      ensure => 'file',
      owner  => 'root',
      group  => 'root',
      mode   => '0644';
    '/tmp/test.test':
       content => brakepuppet("Print this text please");

Puppet Server problem. We have puppet server running on jruby and puppetagent running as ruby client application. Step 1:

This project is part of migration from Puppet5 to Puppet7 and Puppet5 did not use JRuby so we were good with using active-record in this custom function, but now looks like it's our only option.