Skip to content

Commit 88c8b8d

Browse files
binford2kehelms
authored andcommitted
Add OpenVox support
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.
1 parent e72630a commit 88c8b8d

File tree

8 files changed

+68
-21
lines changed

8 files changed

+68
-21
lines changed

README.md

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,8 @@ Then the `foreman_ssl_{ca,cert,key}` parameters are ignored and `certs::puppet`
5656

5757
## PuppetDB integration
5858

59-
The Puppet server can be configured to export catalogs and reports to a
60-
PuppetDB instance, using the puppetlabs/puppetdb module. Use its
61-
`puppetdb::server` class to install the PuppetDB server and this module to
62-
configure the Puppet server to connect to PuppetDB.
59+
The Puppet server can be configured to export catalogs and reports to a PuppetDB instance, using the puppetlabs/puppetdb module.
60+
Use its `puppetdb::server` class to install the PuppetDB server and this module to configure the Puppet server to connect to PuppetDB.
6361

6462
Requires [puppetlabs/puppetdb](https://forge.puppetlabs.com/puppetlabs/puppetdb)
6563

@@ -74,8 +72,9 @@ class { 'puppet::server::puppetdb':
7472
}
7573
```
7674

77-
Above example manages Puppetserver + PuppetDB integration. It won't install the
78-
PuppetDB. To do so, you also need the `puppetdb` class
75+
Above example manages Puppetserver + PuppetDB integration.
76+
It won't install the PuppetDB.
77+
To do so, you also need the `puppetdb` class
7978

8079
```puppet
8180
class { 'puppet':
@@ -115,15 +114,33 @@ class { 'puppet::server::puppetdb':
115114
}
116115
```
117116

118-
Above code will install Puppetserver/PuppetDB/PostgreSQL on a single server. It
119-
will use the upstream postgresql repositories. It was tested on Ubuntu.
117+
Above code will install Puppetserver/PuppetDB/PostgreSQL on a single server.
118+
It will use the upstream postgresql repositories.
119+
It was tested on Ubuntu.
120120

121121
Please also make sure your puppetdb ciphers are compatible with your puppet server ciphers, ie that the two following parameters match:
122+
122123
```
123124
puppet::server::cipher_suites
124125
puppetdb::server::cipher_suites
125126
```
126127

128+
By default, the Perforce packages are used.
129+
[Since November 2024, they don't receive updates anymore](https://www.puppet.com/blog/open-source-puppet-updates-2025).
130+
To use the new [OpenVoxProject packages](https://voxpupuli.org/openvox/), update the package names:
131+
132+
```yaml
133+
---
134+
puppet::client_package: openvox-agent
135+
puppet::server_package: openvox-server
136+
puppetdb::puppetdb_package: openvoxdb
137+
puppetdb::master::config::terminus_package: openvoxdb-termini
138+
```
139+
140+
If you replace the Perforce agent or server packages and switch to the OpenVox implementation by hand, without setting anything in Hiera, the module will detect this and just keeps working, no changes required.
141+
142+
Further installation instructions are also documented on the [OpenVox project page](https://voxpupuli.org/openvox/install/).
143+
127144
# Installation
128145

129146
Available from GitHub (via cloning or tarball), [Puppet Forge](https://forge.puppetlabs.com/theforeman/puppet)

manifests/init.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@
707707
Boolean $server_ssl_key_manage = $puppet::params::server_ssl_key_manage,
708708
Array[String] $server_ssl_protocols = $puppet::params::server_ssl_protocols,
709709
Optional[Stdlib::Absolutepath] $server_ssl_chain_filepath = $puppet::params::server_ssl_chain_filepath,
710-
Optional[Variant[String, Array[String]]] $server_package = $puppet::params::server_package,
710+
Variant[String[1], Array[String[1]]] $server_package = $puppet::params::server_package,
711711
Optional[String] $server_version = $puppet::params::server_version,
712712
String $server_certname = $puppet::params::server_certname,
713713
Integer[0] $server_request_timeout = $puppet::params::server_request_timeout,

manifests/params.pp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -265,22 +265,25 @@
265265

266266
$puppet_major = regsubst($facts['puppetversion'], '^(\d+)\..*$', '\1')
267267

268-
if ($facts['os']['family'] =~ /(FreeBSD|DragonFly)/) {
269-
$server_package = "puppetserver${puppet_major}"
268+
# Add support for OpenVox. Default to puppet if nothing is installed yet
269+
$puppet_implementation = pick($facts['implementation'], 'puppet')
270+
$puppetserver_implementation = bool2str($puppet_implementation == 'openvox', 'openvox-server', 'puppetserver')
271+
272+
$server_package = if ($facts['os']['family'] =~ /(FreeBSD|DragonFly)/) {
273+
"${puppetserver_implementation}${puppet_major}"
270274
} else {
271-
$server_package = undef
275+
$puppetserver_implementation
272276
}
273277

274278
$server_ssl_dir = $ssldir
275279
$server_version = undef
276280

277-
if $aio_package or
278-
($facts['os']['name'] == 'Debian' and versioncmp($facts['os']['release']['major'], '12') >= 0) {
279-
$client_package = ['puppet-agent']
281+
$client_package = if $aio_package or ($facts['os']['name'] == 'Debian' and versioncmp($facts['os']['release']['major'], '12') >= 0) {
282+
["${puppet_implementation}-agent"]
280283
} elsif ($facts['os']['family'] =~ /(FreeBSD|DragonFly)/) {
281-
$client_package = ["puppet${puppet_major}"]
284+
["${puppet_implementation}${puppet_major}"]
282285
} else {
283-
$client_package = ['puppet']
286+
[$puppet_implementation]
284287
}
285288

286289
# Puppet service name

manifests/server.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@
405405
Boolean $ssl_key_manage = $puppet::server_ssl_key_manage,
406406
Array[String] $ssl_protocols = $puppet::server_ssl_protocols,
407407
Optional[Stdlib::Absolutepath] $ssl_chain_filepath = $puppet::server_ssl_chain_filepath,
408-
Optional[Variant[String, Array[String]]] $package = $puppet::server_package,
408+
Variant[String[1], Array[String[1]]] $package = $puppet::server_package,
409409
Optional[String] $version = $puppet::server_version,
410410
String $certname = $puppet::server_certname,
411411
Integer[0] $request_timeout = $puppet::server_request_timeout,

manifests/server/install.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
}
3434

3535
if $puppet::manage_packages == true or $puppet::manage_packages == 'server' {
36-
$server_package = pick($puppet::server::package, 'puppetserver')
36+
$server_package = $puppet::server::package
3737
$server_version = pick($puppet::server::version, $puppet::version)
3838

3939
package { $server_package:

manifests/server/puppetserver.pp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,6 @@
152152
# We need a method to determine what version is installed.
153153
$real_puppetserver_version = pick($puppetserver_version, '8.0.0')
154154

155-
$puppetserver_package = pick($puppet::server::package, 'puppetserver')
156-
157155
if $java_bin {
158156
$_java_bin = $java_bin
159157
} else {

metadata.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636
{
3737
"name": "puppet",
3838
"version_requirement": ">= 8.0.0 < 9.0.0"
39+
},
40+
{
41+
"name": "openvox",
42+
"version_requirement": ">= 8.23.1 < 9.0.0"
3943
}
4044
],
4145
"operatingsystem_support": [

spec/classes/puppet_init_spec.rb

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,25 @@
1010
puppet_concat = '/usr/local/etc/puppet/puppet.conf'
1111
puppet_directory = '/usr/local/etc/puppet'
1212
puppet_package = "puppet#{puppet_major}"
13+
openvox_package = "openvox#{puppet_major}"
1314
puppetconf_mode = '0644'
1415
when 'windows'
1516
puppet_concat = 'C:/ProgramData/PuppetLabs/puppet/etc/puppet.conf'
1617
puppet_directory = 'C:/ProgramData/PuppetLabs/puppet/etc'
1718
puppet_package = 'puppet-agent'
19+
openvox_package = 'openvox-agent'
1820
puppetconf_mode = '0674'
1921
when 'Archlinux'
2022
puppet_concat = '/etc/puppetlabs/puppet/puppet.conf'
2123
puppet_directory = '/etc/puppetlabs/puppet'
2224
puppet_package = 'puppet'
25+
openvox_package = 'openvox'
2326
puppetconf_mode = '0644'
2427
else
2528
puppet_concat = '/etc/puppetlabs/puppet/puppet.conf'
2629
puppet_directory = '/etc/puppetlabs/puppet'
2730
puppet_package = 'puppet-agent'
31+
openvox_package = 'openvox-agent'
2832
puppetconf_mode = '0644'
2933
end
3034

@@ -45,6 +49,27 @@
4549
}
4650
end
4751

52+
describe 'with already installed packages' do
53+
describe 'legacy Perforce opensource packages' do
54+
let :facts do
55+
facts.merge(implementation: 'puppet')
56+
end
57+
it { should contain_package(puppet_package)
58+
.with_ensure('present')
59+
.with_install_options(nil)
60+
}
61+
end
62+
describe 'OpenVox packages' do
63+
let :facts do
64+
facts.merge(implementation: 'openvox')
65+
end
66+
it { should contain_package(openvox_package)
67+
.with_ensure('present')
68+
.with_install_options(nil)
69+
}
70+
end
71+
end
72+
4873
describe 'with server => true', :unless => unsupported_puppetserver_osfamily(facts[:os]['family']) do
4974
let :params do {
5075
:server => true,

0 commit comments

Comments
 (0)