From b3c3deb0cd1556ea199ad6ed94ff7d5911d5c5c1 Mon Sep 17 00:00:00 2001 From: Jerome Charaoui Date: Tue, 16 May 2023 08:34:53 -0400 Subject: [PATCH] Support new non-AIO puppet Debian packages The upcoming release of Debian will ship with a new non-AIO puppetserver package, and these configuration tweaks are needed to make the module compatible with it. --- manifests/params.pp | 24 +++++++++++++++++------- manifests/server/puppetserver.pp | 2 ++ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index d3f06294..14d30bb9 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -147,12 +147,21 @@ $vardir = '/var/lib/puppet' $sharedir = '/usr/share/puppet' $bindir = '/usr/bin' - $server_puppetserver_dir = '/etc/puppetserver' - $server_puppetserver_vardir = $vardir - $server_puppetserver_rundir = undef - $server_puppetserver_logdir = undef - $server_ruby_load_paths = [] - $server_jruby_gem_home = '/var/lib/puppet/jruby-gems' + if $facts['os']['family'] == 'Debian' { + $server_puppetserver_dir = '/etc/puppet/puppetserver' + $server_puppetserver_vardir = '/var/lib/puppetserver' + $server_puppetserver_rundir = '/run/puppetserver' + $server_puppetserver_logdir = '/var/log/puppetserver' + $server_ruby_load_paths = ['/usr/lib/puppetserver/ruby/vendor_ruby'] + $server_jruby_gem_home = '/var/lib/puppetserver/jruby-gems' + } else { + $server_puppetserver_dir = '/etc/puppetserver' + $server_puppetserver_vardir = $vardir + $server_puppetserver_rundir = undef + $server_puppetserver_logdir = undef + $server_ruby_load_paths = [] + $server_jruby_gem_home = '/var/lib/puppet/jruby-gems' + } } $root_group = undef $puppetconf_mode = '0644' @@ -269,7 +278,8 @@ $server_ssl_dir = $ssldir $server_version = undef - if $aio_package { + if $aio_package or + ($facts['os']['name'] == 'Debian' and versioncmp($facts['os']['release']['major'], '12') >= 0) { $client_package = ['puppet-agent'] } elsif ($facts['os']['family'] =~ /(FreeBSD|DragonFly)/) { $client_package = ["puppet${puppet_major}"] diff --git a/manifests/server/puppetserver.pp b/manifests/server/puppetserver.pp index 3521c7f9..57688dd9 100644 --- a/manifests/server/puppetserver.pp +++ b/manifests/server/puppetserver.pp @@ -163,6 +163,8 @@ context => '/files/etc/rc.conf', changes => ["set puppetserver_java_opts '\"${jvm_cmd}\"'"], } + } elsif $facts['os']['family'] == 'Debian' and !$puppet::params::aio_package { + $server_gem_paths = ['${jruby-puppet.gem-home}', '/usr/lib/puppetserver/vendored-jruby-gems'] # lint:ignore:single_quote_string_with_variables } else { if $jvm_cli_args { $changes = [