Skip to content

Conversation

bastelfreak
Copy link
Member

This adds a fact that discovers if the Perforce or OpenVox agent is installed. If none are installed yet, we default to the Perforce package for backwards compatibility.

This adds a fact that discovers if the Perforce or OpenVox agent is
installed. If none are installed yet, we default to the Perforce package
for backwards compatibility.
@bastelfreak
Copy link
Member Author

bastelfreak commented Mar 11, 2025

This is a resubmission of #933. I pasically added pick() to handle situations where the fact is undef.

@@ -0,0 +1,10 @@
# frozen_string_literal: true

Facter.add('puppet_flavor') do
Copy link
Member Author

@bastelfreak bastelfreak Mar 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In voxpupuli/puppet_metadata#165 we started to use implementation instead of favor. But maybe favor (or please flavour) is better because it's shorter? Either way, I think we should be consistent.

Copy link
Member

@ekohl ekohl Mar 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any thoughts on enhancing openvox itself to provide an openvox_version fact, just like there's puppet_version? I imagine other software could also use it.

Going the structured route a puppet fact could work:

{
  "version": {
    "full": "x.y.z",
    "major": "x"
  },
  "implementation": "openvox",
}

vendor might also be an option.

Feels like something for the language steering committee.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this idea. I'll add it to the steering committee agenda

Copy link

@krisavi krisavi May 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't facter responsible for providing facts? It does provide aio_agent_version already, why not add variant, vendor, flavor, implementation or whatever you are going to call it as extra fact there. Changing how version is printed there would not be backwards compatible. Adding separate fact for puppet-agent could help.

When it is not coming from facter then we could assume it is "perforce puppet", but would be good if the steering committee could agree that both sides will add the fact in same format and with same name there.

puppet_metadata seems to be another binary that has to be called out by custom fact, which doesn't quite solve it for out of the box solution.

Oh and about the check foreman is using, then that is not consistent. It may not be enough to know which one is used. At least in case of RHEL7-9 and puppet/openvox v7.*

 dnf info openvox-agent | head -n3
Installed Packages
Name         : openvox-agent
Version      : 7.36.1

 dnf list installed | grep puppet
puppet7-release.noarch    7.0.0-20.el9     @puppet7   # that is only repo, not actual binary

 puppet --help | tail -n1
Puppet v7.36.1

 facter | grep version
aio_agent_version => 7.36.1
augeas => {
  version => "1.14.1"
}
dmi => {
  bios => {
    version => "6.00"
  },
}
facterversion => 4.2.8
kernelmajversion => 5.14
kernelversion => 5.14.0
os => {
  selinux => {
    policy_version => "33"
  },
}
ruby => {
  platform => "x86_64-linux",
  sitedir => "/usr/local/share/ruby/site_ruby",
  version => "3.0.7"
}

Cleaned up some output, but at least on v7 branch openvox agent doesn't report much differently from puppet agent.

@bastelfreak bastelfreak force-pushed the add_openvox_support branch 2 times, most recently from 4599b6e to 76dc42e Compare March 11, 2025 12:55
@bastelfreak bastelfreak force-pushed the add_openvox_support branch from 76dc42e to b43a016 Compare March 11, 2025 12:57
@charlesc-profusion
Copy link

This doesn't work on Openvox 7:
image

@binford2k
Copy link

ah yeah, we didn't backport that to 7.x. We probably should. Lemme chat with the team.

@Stricken1670
Copy link

Stricken1670 commented Mar 14, 2025

EDIT: found it!

So I just installed this module and it's active, and I applied the https://github.com/theforeman/puppet-puppet/pull/935.diff for this PR and now I can install openvox with:

  if $facts['networking']['hostname'] == 'labrat' {
    class {
      'puppet':
        runmode => 'cron',
        client_package => 'openvox-agent',
        agent_server_hostname => 'theforeman.example.com',
    }
  }

Although it doesn't set up the repo yet.

@markeganfuller
Copy link

I think it's also required that terminus_package is set to openvoxdb-termini on puppetdb::master::config in puppet::server::puppetdb.

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make it reflect that OpenVox introduced an implementation fact?

Stdlib::Host $server = undef,
Stdlib::Port $port = 8081,
Boolean $soft_write_failure = false,
String[1] $terminus_package = 'puppetdb-termini',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#936 is open for this same change and there I also suggested to make it Optional

Suggested change
String[1] $terminus_package = 'puppetdb-termini',
Optional[String[1]] $terminus_package = undef,

@sbernhard
Copy link

@bastelfreak Any plans to continue this? (looks like there are conflicts as #936 was already merged)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants