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

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

Open
bimax opened this issue Aug 10, 2023 · 0 comments
Open

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

bimax opened this issue Aug 10, 2023 · 0 comments

Comments

@bimax
Copy link

bimax commented Aug 10, 2023

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:

  • I manually run agent to sync first time. > puppet agent --test.
  • Agent requests the catalog first time
  • It executes brakepuppet function but
  • compile catalog and
  • returns it from the server to the agent
    Step 2:
  • Manually run puppet agent second time
  • puppet server "asks" (no errors in the debug log) agent to clean up local cache lib directories
  • which then brakes catalog application (in case of more complex catalog then you see above).
    My assumption:
  • puppetserver see changes some lib folder (cache creation)
  • puppetserver do not see library directories on the agent as there is pure ruby app
  • some difference between master and agent because of agent does not have/need this gem as we run ruby app (not jruby).
    and (reality)
  • activerecord-jdbc-adapter redefines some ruby env to change puppet behavior

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.

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

1 participant