Skip to content

Commit b458215

Browse files
binford2kbastelfreak
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 eebbe0a commit b458215

File tree

4 files changed

+61
-16
lines changed

4 files changed

+61
-16
lines changed

README.md

Lines changed: 21 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,29 @@ 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 name:
131+
132+
```puppet
133+
class { 'puppet::server::puppetdb':
134+
terminus_package => 'openvoxdb-termini',
135+
}
136+
```
137+
138+
If you replace the Perforce packages and switch to the OpenVox implementation by hand, the module will detect this and just keep working, no changes required.
139+
127140
# Installation
128141

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

manifests/params.pp

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

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

266-
if ($facts['os']['family'] =~ /(FreeBSD|DragonFly)/) {
267-
$server_package = "puppetserver${puppet_major}"
266+
# Add support for OpenVox. Default to puppet if nothing is installed yet
267+
$puppet_flavor = pick($facts['implementation'], 'puppet')
268+
$puppetserver_flavor = regsubst("${puppet_flavor}server", 'openvox', 'openvox-')
269+
270+
$server_package = if ($facts['os']['family'] =~ /(FreeBSD|DragonFly)/) {
271+
"${puppetserver_flavor}${puppet_major}"
268272
} else {
269-
$server_package = undef
273+
$puppetserver_flavor
270274
}
271275

272276
$server_ssl_dir = $ssldir
273277
$server_version = undef
274278

275-
if $aio_package or
276-
($facts['os']['name'] == 'Debian' and versioncmp($facts['os']['release']['major'], '12') >= 0) {
277-
$client_package = ['puppet-agent']
279+
$client_package = if $aio_package or ($facts['os']['name'] == 'Debian' and versioncmp($facts['os']['release']['major'], '12') >= 0) {
280+
["${puppet_flavor}-agent"]
278281
} elsif ($facts['os']['family'] =~ /(FreeBSD|DragonFly)/) {
279-
$client_package = ["puppet${puppet_major}"]
282+
["${puppet_flavor}${puppet_major}"]
280283
} else {
281-
$client_package = ['puppet']
284+
[$puppet_flavor]
282285
}
283286

284287
# Puppet service name

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)