Skip to content

add possibility to manage puppetdb terminus package #424

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

techsk8
Copy link

@techsk8 techsk8 commented Feb 25, 2025

I'd like to be able to install openvoxdb-termini through the main class and currently that's not possible.

@techsk8 techsk8 requested review from bastelfreak, smortex and a team as code owners February 25, 2025 13:18
@CLAassistant
Copy link

CLAassistant commented Feb 25, 2025

CLA assistant check
All committers have signed the CLA.

@techsk8 techsk8 force-pushed the syseleven_puppetdb_terminus_package branch 2 times, most recently from e062c81 to 3ad0d11 Compare February 27, 2025 10:28
@bastelfreak
Copy link
Collaborator

greetings to sys11 from betadots :)

@techsk8 techsk8 force-pushed the syseleven_puppetdb_terminus_package branch 3 times, most recently from 14e88f2 to 82ecf0e Compare February 27, 2025 13:09
@techsk8 techsk8 force-pushed the syseleven_puppetdb_terminus_package branch from 82ecf0e to 742cf16 Compare March 3, 2025 12:40
@techsk8 techsk8 requested a review from bastelfreak March 3, 2025 12:40
@KoenDierckx
Copy link
Contributor

Also looking forward to openvox support from this module

@jadestorm
Copy link

Hi @techsk8 -- so as is this doesn't really "do" anything. Meaning it adds a parameter but it does not change the code that references $puppetdb::params::terminus_package directly.

However -- you can accomplish this already "as is" with:
puppetdb::master::config::terminus_package: 'openvoxdb-termini'

At least as far as I have tested so far.

@techsk8
Copy link
Author

techsk8 commented Apr 9, 2025

Hi @jadestorm,
Well, that depends on how you actually use the puppetdb module. I use it contained inside a wrapper si I'm only calling puppetdb and passing the params like shown below. So in my case the above is useful and does "do" something:

class mywrapper_puppet::puppetdb::upstream (
) {
  assert_private()

  ##
  ## Upstream module
  ##
  class { 'puppetdb':
    certificate_whitelist     => $mywrapper_puppet::puppetdb::certificate_whitelist,
    cipher_suites             => $mywrapper_puppet::puppetdb::cipher_suites,
    command_threads           => $mywrapper_puppet::puppetdb::command_threads,
    database_password         => $mywrapper_puppet::puppetdb::database_password,
    disable_cleartext         => $mywrapper_puppet::puppetdb::disable_cleartext,
    disable_update_checking   => $mywrapper_puppet::puppetdb::disable_update_checking,
    java_args                 => $mywrapper_puppet::puppetdb::java_args,
    manage_firewall           => $mywrapper_puppet::puppetdb::manage_firewall,
    manage_package_repo       => false,
    max_threads               => $mywrapper_puppet::puppetdb::max_threads,
    node_purge_ttl            => $mywrapper_puppet::puppetdb::node_purge_ttl,
    node_ttl                  => $mywrapper_puppet::puppetdb::node_ttl,
    postgres_version          => $mywrapper_puppet::puppetdb::postgres_version,
    puppetdb_terminus_package => $mywrapper_puppet::puppetdb_terminus_package,
    puppetdb_package          => $mywrapper_puppet::puppetdb_package,
    report_ttl                => $mywrapper_puppet::puppetdb::report_ttl,
    ssl_listen_address        => $mywrapper_puppet::puppetdb::ssl_listen_address,
  }
.
.
.
}

@jadestorm
Copy link

Hi @techsk8 ! Sorry yesterday I was in a hurry I meant to show you what I was referring to. So what I see under files changed is that you added an option to pass in the parameter:
String[1] $puppetdb_terminus_package = $puppetdb::params::terminus_package,

And some documentation. However, the part of the code that actually creates the terminus package resource is in:
https://github.com/puppetlabs/puppetlabs-puppetdb/blob/main/manifests/master/config.pp

Specifically:

  package { $terminus_package:
    ensure => $puppetdb::params::puppetdb_version,
  }

Which is set from puppetdb::master:config's parameter:
$terminus_package = $puppetdb::params::terminus_package,

Now as you can see -- unless you explicitly set that parameter on puppetdb::master::config, it defaults to $puppetdb::params::terminus_package, which would bypass your puppetdb::puppetdb_terminus_package setting.

Now, as is, puppetdb::master::config inherits puppetdb::params, do just changing the default on that class isn't going to accomplish anything.

However, the documentation suggests using it like:

node <hostname> {
  # Configure puppetdb and its underlying database
  class { 'puppetdb': }
  
  # Configure the Puppet master to use puppetdb
  class { 'puppetdb::master::config': }
}

In which case, you could simply pass the terminus_package param to your call of puppetdb::master::config there.

FWIW I did try your fork and it didn't change what package it was trying to pull in, so I went digging to try to figure out why and that's when I found I could work around it.

@techsk8
Copy link
Author

techsk8 commented Apr 29, 2025

I understand what you're saying.
But the way I'm applying puppet code on my nodes is only through hiera config. I'm not using manifests/site.pp for anything, but assigning classes and roles, something in the lines of:

lookup('classes', { merge => 'unique' }).include

Actually, I think the main point of Hiera and Puppet is that it enables you to separate configuration data from your Puppet manifests, making your code more reusable and easier to manage.
But if you prefer managing your node's config with your nodes from manifests/site.pp then your point makes sense. 😄
In my wrapper class that I use for managing puppet, in the case of puppetdb the only class I call for that is puppetdband puppetdb::globals nothing else, so for me it makes sense to pass in the $terminus_package param to puppetdb directly.

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

Successfully merging this pull request may close these issues.

5 participants