diff --git a/manifests/params.pp b/manifests/params.pp index 4d27357..9079705 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -99,34 +99,26 @@ class puppetdb::params inherits puppetdb::globals { $test_url = '/v3/version' } else { case $::osfamily { - 'RedHat', 'Suse': { + 'RedHat', 'Suse', 'Archlinux','Debian': { $etcdir = '/etc/puppetlabs/puppetdb' $puppet_confdir = pick($settings::confdir,'/etc/puppetlabs/puppet') $puppet_service_name = 'puppetserver' - $terminus_package = "puppetdb-terminus" - } - 'Archlinux','Debian': { - $etcdir = '/etc/puppetlabs/puppetdb' - $puppet_confdir = pick($settings::confdir,'/etc/puppetlabs/puppet') - $puppet_service_name = 'puppetserver' - $terminus_package = "puppetdb-termini" } 'OpenBSD': { $etcdir = '/etc/puppetlabs/puppetdb' $puppet_confdir = pick($settings::confdir,'/etc/puppetlabs/puppet') $puppet_service_name = undef - $terminus_package = "puppetdb-termini" } 'FreeBSD': { $etcdir = '/usr/local/etc/puppetlabs/puppetdb' $puppet_confdir = pick($settings::confdir,'/usr/local/etc/puppetlabs/puppet') $puppet_service_name = undef - $terminus_package = "puppetdb-termini" } default: { fail("The fact 'osfamily' is set to ${::osfamily} which is not supported by the puppetdb module.") } } + $terminus_package = 'puppetdb-termini' $test_url = '/pdb/meta/v1/version' $vardir = '/opt/puppetlabs/server/data/puppetdb' $database_embedded_path = "${vardir}/db/db" diff --git a/spec/unit/classes/master/config_spec.rb b/spec/unit/classes/master/config_spec.rb index a384975..ca4c7db 100644 --- a/spec/unit/classes/master/config_spec.rb +++ b/spec/unit/classes/master/config_spec.rb @@ -2,10 +2,8 @@ require 'spec_helper' describe 'puppetdb::master::config', :type => :class do - before :each do - - @facter_facts = - { + let(:facts) do + { :fqdn => 'puppetdb.example.com', :osfamily => 'Debian', :operatingsystem => 'Debian', @@ -19,8 +17,6 @@ describe 'puppetdb::master::config', :type => :class do } end - let (:facts) {@facter_facts} - context 'when PuppetDB on remote server' do context 'when using default values' do @@ -35,17 +31,17 @@ describe 'puppetdb::master::config', :type => :class do let(:pre_condition) { 'class { "puppetdb": }' } it { should contain_puppetdb_conn_validator('puppetdb_conn').with( - :puppetdb_server => 'puppetdb.example.com', - :puppetdb_port => '8081', - :use_ssl => 'true') } + :puppetdb_server => 'puppetdb.example.com', + :puppetdb_port => '8081', + :use_ssl => 'true') } end context 'when puppetdb class is declared with disable_ssl => true' do let(:pre_condition) { 'class { "puppetdb": disable_ssl => true }' } it { should contain_puppetdb_conn_validator('puppetdb_conn').with( - :puppetdb_port => '8080', - :use_ssl => 'false')} + :puppetdb_port => '8080', + :use_ssl => 'false')} end context 'when puppetdb_port => 1234' do @@ -53,8 +49,8 @@ describe 'puppetdb::master::config', :type => :class do let(:params) do { :puppetdb_port => '1234' } end it { should contain_puppetdb_conn_validator('puppetdb_conn').with( - :puppetdb_port => '1234', - :use_ssl => 'true')} + :puppetdb_port => '1234', + :use_ssl => 'true')} end context 'when puppetdb_port => 1234 AND the puppetdb class is declared with disable_ssl => true' do @@ -62,33 +58,22 @@ describe 'puppetdb::master::config', :type => :class do let(:params) do {:puppetdb_port => '1234'} end it { should contain_puppetdb_conn_validator('puppetdb_conn').with( - :puppetdb_port => '1234', - :use_ssl => 'false')} + :puppetdb_port => '1234', + :use_ssl => 'false')} end - + context 'when using default values' do it { should contain_package('puppetdb-termini').with( :ensure => 'present' )} it { should contain_puppetdb_conn_validator('puppetdb_conn').with(:test_url => '/pdb/meta/v1/version')} end - + context 'when using an older puppetdb version' do let (:pre_condition) { 'class { "puppetdb::globals": version => "2.2.0", }' } it { should contain_package('puppetdb-terminus').with( :ensure => '2.2.0' )} it { should contain_puppetdb_conn_validator('puppetdb_conn').with(:test_url => '/v3/version')} end - context 'when using puppetdb 3+' do - let (:pre_condition) { 'class { "puppetdb::globals": version => "3.2.0", }'} - it { should contain_package('puppetdb-termini').with( :ensure => '3.2.0' )} - end end - context 'when using puppetdb 3+' do - before :each do - @facter_facts[:osfamily] = "RedHat" - end - let (:pre_condition) { 'class {"puppetdb::globals": version => "3.2.0", }' } - it { should contain_package('puppetdb-terminus').with( :ensure => '3.2.0' )} - end end