diff --git a/manifests/puppet/puppetdb.pp b/manifests/puppet/puppetdb.pp index be8ee4a7..1e037109 100644 --- a/manifests/puppet/puppetdb.pp +++ b/manifests/puppet/puppetdb.pp @@ -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'] @@ -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']] } } diff --git a/manifests/puppet/puppetserver/install.pp b/manifests/puppet/puppetserver/install.pp index b86d6aad..0d55c2f0 100644 --- a/manifests/puppet/puppetserver/install.pp +++ b/manifests/puppet/puppetserver/install.pp @@ -6,10 +6,15 @@ realize Group['puppet'] realize User['puppet'] + realize Apt::Source['openvox'] realize Apt::Source['puppet'] - package { 'puppetserver': + package { 'openvox-server': ensure => $version, require => [Class['profiles::java'], Group['puppet'], User['puppet']] } + + package { 'puppetserver': + ensure => 'purged' + } } diff --git a/manifests/puppet/puppetserver/puppetdb.pp b/manifests/puppet/puppetserver/puppetdb.pp index da355f65..1c132c6e 100644 --- a/manifests/puppet/puppetserver/puppetdb.pp +++ b/manifests/puppet/puppetserver/puppetdb.pp @@ -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 => 'purged' + } file { 'puppetserver puppetdb.conf': ensure => 'file', @@ -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' @@ -69,10 +82,6 @@ } } - package { 'puppetdb-termini': - ensure => $termini_version - } - ini_setting { 'puppetserver reports': ensure => $reports, path => '/etc/puppetlabs/puppet/puppet.conf', diff --git a/spec/classes/puppet/puppetdb_spec.rb b/spec/classes/puppet/puppetdb_spec.rb index 0b82b97b..35ca1273 100644 --- a/spec/classes/puppet/puppetdb_spec.rb +++ b/spec/classes/puppet/puppetdb_spec.rb @@ -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') } @@ -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' => {}, @@ -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]') } @@ -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' => { diff --git a/spec/classes/puppet/puppetserver/install_spec.rb b/spec/classes/puppet/puppetserver/install_spec.rb index cc999dc8..f4433cb7 100644 --- a/spec/classes/puppet/puppetserver/install_spec.rb +++ b/spec/classes/puppet/puppetserver/install_spec.rb @@ -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 @@ -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 diff --git a/spec/classes/puppet/puppetserver/puppetdb_spec.rb b/spec/classes/puppet/puppetserver/puppetdb_spec.rb index 0579a9e9..e8f5c92a 100644 --- a/spec/classes/puppet/puppetserver/puppetdb_spec.rb +++ b/spec/classes/puppet/puppetserver/puppetdb_spec.rb @@ -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' ) } @@ -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' ) } @@ -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]') } @@ -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' ) }