Skip to content

Commit eac110a

Browse files
d1nuc0mbastelfreak
authored andcommitted
feat: use OpenVox packages when possible
1 parent 090c7fe commit eac110a

File tree

6 files changed

+51
-13
lines changed

6 files changed

+51
-13
lines changed

manifests/params.pp

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,30 +113,38 @@
113113
$test_url = '/v3/version'
114114
} else {
115115
case fact('os.family') {
116-
'RedHat', 'Suse', 'Archlinux','Debian': {
116+
'Archlinux': {
117117
$puppetdb_package = 'puppetdb'
118118
$terminus_package = 'puppetdb-termini'
119119
$etcdir = '/etc/puppetlabs/puppetdb'
120120
$puppet_confdir = pick($puppetdb::globals::puppet_confdir,'/etc/puppetlabs/puppet')
121121
$puppet_service_name = 'puppetserver'
122122
$vardir = '/opt/puppetlabs/server/data/puppetdb'
123123
}
124-
'OpenBSD': {
125-
$puppetdb_package = 'puppetdb'
126-
$terminus_package = 'puppetdb-termini'
124+
'Debian', 'RedHat', 'Suse': {
125+
$puppetdb_package = 'openvoxdb'
126+
$terminus_package = 'openvoxdb-termini'
127127
$etcdir = '/etc/puppetlabs/puppetdb'
128128
$puppet_confdir = pick($puppetdb::globals::puppet_confdir,'/etc/puppetlabs/puppet')
129-
$puppet_service_name = undef
129+
$puppet_service_name = 'puppetserver'
130130
$vardir = '/opt/puppetlabs/server/data/puppetdb'
131131
}
132132
'FreeBSD': {
133-
$puppetdb_package = inline_epp('puppetdb<%= $puppetdb::params::puppetdb_major_version %>')
134-
$terminus_package = inline_epp('puppetdb-terminus<%= $puppetdb::params::puppetdb_major_version %>')
133+
$puppetdb_package = inline_epp('openvoxdb<%= $puppetdb::params::puppetdb_major_version %>')
134+
$terminus_package = inline_epp('openvoxdb-terminus<%= $puppetdb::params::puppetdb_major_version %>')
135135
$etcdir = '/usr/local/etc/puppetdb'
136136
$puppet_confdir = pick($puppetdb::globals::puppet_confdir,'/usr/local/etc/puppet')
137137
$puppet_service_name = 'puppetserver'
138138
$vardir = '/var/db/puppetdb'
139139
}
140+
'OpenBSD': {
141+
$puppetdb_package = 'puppetdb'
142+
$terminus_package = 'puppetdb-termini'
143+
$etcdir = '/etc/puppetlabs/puppetdb'
144+
$puppet_confdir = pick($puppetdb::globals::puppet_confdir,'/etc/puppetlabs/puppet')
145+
$puppet_service_name = undef
146+
$vardir = '/opt/puppetlabs/server/data/puppetdb'
147+
}
140148
default: {
141149
fail("The fact 'os.family' is set to ${fact('os.family')} which is not supported by the puppetdb module.")
142150
}

spec/support/acceptance/shared/puppetdb.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
line => '#PIDFile=/run/puppetlabs/puppetdb/puppetdb.pid',
1111
match => '^PIDFile.*',
1212
append_on_no_match => false,
13-
require => Package['puppetdb'],
13+
require => Package['openvoxdb'],
1414
notify => Service['puppetdb'],
1515
}
1616
}

spec/support/acceptance/shared/puppetserver.pp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
line => '#PIDFile=/run/puppetlabs/puppetserver.pid',
3939
match => '^PIDFile.*',
4040
append_on_no_match => false,
41-
require => Package['puppetserver'],
41+
require => Package['openvox-server'],
4242
notify => Service['puppetserver'],
4343
}
4444
}
@@ -48,7 +48,19 @@
4848
default => '/etc/sysconfig',
4949
}
5050

51-
package { 'puppetserver':
51+
case fact('os.family') {
52+
'Archlinux': {
53+
$puppetserver_package = 'puppetserver'
54+
}
55+
'Debian', 'RedHat', 'Suse': {
56+
$puppetserver_package = 'openvox-server'
57+
}
58+
default: {
59+
fail("The fact 'os.family' is set to ${fact('os.family')} which is not supported by the puppetdb module.")
60+
}
61+
}
62+
63+
package { $puppetserver_package:
5264
ensure => installed,
5365
}
5466
# savagely disable dropsonde

spec/unit/classes/database/postgresql_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
grant: 'all',
6464
port: params[:database_port].to_i,
6565
encoding: 'UTF8',
66-
locale: 'en_US.UTF-8'
66+
locale: 'C.UTF-8'
6767
)
6868
}
6969

spec/unit/classes/master/config_spec.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77
context "on #{os}" do
88
let(:facts) { facts }
99

10+
let(:termini_package_name) do
11+
case facts[:os]['family']
12+
when 'Archlinux', 'OpenBSD'
13+
'puppetdb-termini'
14+
when 'Debian', 'RedHat', 'Suse'
15+
'openvoxdb-termini'
16+
end
17+
end
18+
1019
context 'when PuppetDB on remote server' do
1120
context 'when using default values' do
1221
it { is_expected.to compile.with_all_deps }
@@ -62,7 +71,7 @@
6271
end
6372

6473
context 'when using default values' do
65-
it { is_expected.to contain_package('puppetdb-termini').with(ensure: 'present') }
74+
it { is_expected.to contain_package(termini_package_name).with(ensure: 'present') }
6675
it { is_expected.to contain_puppetdb_conn_validator('puppetdb_conn').with(test_url: '/pdb/meta/v1/version') }
6776
end
6877

spec/unit/classes/server_spec.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@
1414
end
1515
end
1616

17+
let(:package_name) do
18+
case facts[:os]['family']
19+
when 'Archlinux', 'OpenBSD'
20+
'puppetdb'
21+
when 'Debian', 'RedHat', 'Suse'
22+
'openvoxdb'
23+
end
24+
end
25+
1726
on_supported_os.each do |os, facts|
1827
context "on #{os}" do
1928
let(:facts) { facts }
@@ -28,7 +37,7 @@
2837
it { is_expected.to contain_class('puppetdb::server::puppetdb') }
2938

3039
it {
31-
is_expected.to contain_package('puppetdb').
40+
is_expected.to contain_package(package_name).
3241
that_notifies('Service[puppetdb]')
3342
}
3443

0 commit comments

Comments
 (0)