Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion manifests/puppet/puppetdb.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
realize Group['puppetdb']
realize User['puppetdb']
realize Apt::Source['puppet']
realize Apt::Source['openvox']

realize Firewall['300 accept puppetdb HTTPS traffic']

Expand All @@ -43,10 +44,11 @@
class { 'puppetdb::server':
database_host => '127.0.0.1',
manage_firewall => false,
puppetdb_package => 'openvoxdb',
puppetdb_service_status => $service_status,
java_args => $java_args,
ssl_deploy_certs => false,
ssl_set_cert_paths => true,
require => [Group['puppetdb'], User['puppetdb'], Apt::Source['puppet'], Class['profiles::java'], Class['puppetdb::globals'], Class['puppetdb::database::postgresql']]
require => [Group['puppetdb'], User['puppetdb'], Apt::Source['openvox'], Class['profiles::java'], Class['puppetdb::globals'], Class['puppetdb::database::postgresql']]
}
}
19 changes: 14 additions & 5 deletions manifests/puppet/puppetserver/puppetdb.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@

realize Group['puppet']
realize User['puppet']
realize Apt::Source['openvox']

package { 'openvoxdb-termini':
ensure => $termini_version,
require => Apt::Source['openvox']
}

package { 'puppetdb-termini':
ensure => 'absent'
}

file { 'puppetserver puppetdb.conf':
ensure => 'file',
Expand Down Expand Up @@ -54,10 +64,13 @@
require => [Group['puppet'], User['puppet']]
}
} else {
$termini_version = 'absent'
$reports = 'absent'
$storeconfigs = 'absent'

package { 'openvoxdb-termini':
ensure => 'absent'
}

file { 'puppetserver puppetdb.conf':
ensure => 'absent',
path => '/etc/puppetlabs/puppet/puppetdb.conf'
Expand All @@ -69,10 +82,6 @@
}
}

package { 'puppetdb-termini':
ensure => $termini_version
}

ini_setting { 'puppetserver reports':
ensure => $reports,
path => '/etc/puppetlabs/puppet/puppet.conf',
Expand Down
5 changes: 4 additions & 1 deletion spec/classes/puppet/puppetdb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
it { is_expected.to contain_user('puppetdb') }

it { is_expected.to contain_apt__source('puppet') }
it { is_expected.to contain_apt__source('openvox') }
it { is_expected.to contain_firewall('300 accept puppetdb HTTPS traffic') }

it { is_expected.to contain_class('profiles::java') }
Expand All @@ -45,6 +46,7 @@

it { is_expected.to contain_class('puppetdb::server').with(
'database_host' => '127.0.0.1',
'puppetdb_package' => 'openvoxdb',
'puppetdb_service_status' => 'running',
'manage_firewall' => false,
'java_args' => {},
Expand All @@ -61,7 +63,7 @@

it { is_expected.to contain_class('puppetdb::server').that_requires('Group[puppetdb]') }
it { is_expected.to contain_class('puppetdb::server').that_requires('User[puppetdb]') }
it { is_expected.to contain_class('puppetdb::server').that_requires('Apt::Source[puppet]') }
it { is_expected.to contain_class('puppetdb::server').that_requires('Apt::Source[openvox]') }

it { is_expected.to contain_class('puppetdb::server').that_requires('Class[puppetdb::globals]') }
it { is_expected.to contain_class('puppetdb::server').that_requires('Class[profiles::java]') }
Expand Down Expand Up @@ -89,6 +91,7 @@

it { is_expected.to contain_class('puppetdb::server').with(
'database_host' => '127.0.0.1',
'puppetdb_package' => 'openvoxdb',
'puppetdb_service_status' => 'stopped',
'manage_firewall' => false,
'java_args' => {
Expand Down
13 changes: 7 additions & 6 deletions spec/classes/puppet/puppetserver/install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@
it { is_expected.to contain_user('puppet') }

it { is_expected.to contain_apt__source('puppet') }
it { is_expected.to contain_apt__source('openvox') }

it { is_expected.to contain_class('profiles::java') }
it { is_expected.to contain_package('puppetserver').with(
it { is_expected.to contain_package('openvox-server').with(
'ensure' => 'installed'
) }

it { is_expected.to contain_package('puppetserver').that_requires('Group[puppet]') }
it { is_expected.to contain_package('puppetserver').that_requires('User[puppet]') }
it { is_expected.to contain_package('puppetserver').that_requires('Apt::Source[puppet]') }
it { is_expected.to contain_package('puppetserver').that_requires('Class[profiles::java]') }
it { is_expected.to contain_package('openvox-server').that_requires('Group[puppet]') }
it { is_expected.to contain_package('openvox-server').that_requires('User[puppet]') }
it { is_expected.to contain_package('openvox-server').that_requires('Apt::Source[openvox]') }
it { is_expected.to contain_package('openvox-server').that_requires('Class[profiles::java]') }
end

context "with version => 1.2.3" do
Expand All @@ -37,7 +38,7 @@

it { is_expected.to compile.with_all_deps }

it { is_expected.to contain_package('puppetserver').with(
it { is_expected.to contain_package('openvox-server').with(
'ensure' => '1.2.3'
) }
end
Expand Down
9 changes: 6 additions & 3 deletions spec/classes/puppet/puppetserver/puppetdb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
'version' => nil
) }

it { is_expected.to contain_package('puppetdb-termini').with(
it { is_expected.not_to contain_apt__source('openvoxdb') }

it { is_expected.to contain_package('openvoxdb-termini').with(
'ensure' => 'absent'
) }

Expand Down Expand Up @@ -61,7 +63,7 @@

it { is_expected.to compile.with_all_deps }

it { is_expected.to contain_package('puppetdb-termini').with(
it { is_expected.to contain_package('openvoxdb-termini').with(
'ensure' => 'installed'
) }

Expand Down Expand Up @@ -125,6 +127,7 @@
'source' => 'puppet:///modules/profiles/puppet/puppetserver/routes.yaml'
) }

it { is_expected.to contain_package('openvoxdb-termini').that_requires('Apt::Source[openvox]') }
it { is_expected.to contain_file('puppetserver puppetdb.conf').that_requires('Group[puppet]') }
it { is_expected.to contain_file('puppetserver puppetdb.conf').that_requires('User[puppet]') }
it { is_expected.to contain_file('puppetserver routes.yaml').that_requires('Group[puppet]') }
Expand All @@ -139,7 +142,7 @@
'version' => '7.2.1'
} }

it { is_expected.to contain_package('puppetdb-termini').with(
it { is_expected.to contain_package('openvoxdb-termini').with(
'ensure' => '7.2.1'
) }

Expand Down
Loading