diff --git a/examples/pgsql/standalone-icingadb.pp b/examples/pgsql/standalone-icingadb.pp index 653879b..3b07df5 100644 --- a/examples/pgsql/standalone-icingadb.pp +++ b/examples/pgsql/standalone-icingadb.pp @@ -34,7 +34,7 @@ class { 'icinga::web::director': db_type => 'pgsql', - db_pass => 'director', + db_pass => Sensitive('director'), manage_database => true, endpoint => $facts['networking']['fqdn'], api_pass => $icinga::server::director_api_pass, diff --git a/manifests/web/director.pp b/manifests/web/director.pp index 318525c..654607e 100644 --- a/manifests/web/director.pp +++ b/manifests/web/director.pp @@ -57,15 +57,6 @@ ) { icinga::prepare_web('Director') - unless $db_port { - $_db_port = $db_type ? { - 'pgsql' => 5432, - default => 3306, - } - } else { - $_db_port = $db_port - } - # # Database # @@ -92,6 +83,7 @@ install_method => 'package', db_type => $db_type, db_host => $_db_host, + db_port => $db_port, db_name => $db_name, db_username => $db_user, db_password => $db_pass, diff --git a/manifests/web/vspheredb.pp b/manifests/web/vspheredb.pp index 66d447a..604c5c6 100644 --- a/manifests/web/vspheredb.pp +++ b/manifests/web/vspheredb.pp @@ -41,15 +41,6 @@ ) { icinga::prepare_web('VSphereDB') - unless $db_port { - $_db_port = $db_type ? { - 'pgsql' => 5432, - default => 3306, - } - } else { - $_db_port = $db_port - } - $_db_charset = $db_type ? { 'mysql' => 'utf8mb4', default => 'UTF8', @@ -81,6 +72,7 @@ install_method => 'package', db_type => $db_type, db_host => $_db_host, + db_port => $db_port, db_name => $db_name, db_username => $db_user, db_password => $db_pass, diff --git a/spec/classes/repos_spec.rb b/spec/classes/repos_spec.rb index 1d7f6ec..0541cec 100644 --- a/spec/classes/repos_spec.rb +++ b/spec/classes/repos_spec.rb @@ -19,6 +19,7 @@ it { is_expected.not_to contain_yumrepo('icinga-testing-builds') } it { is_expected.not_to contain_yumrepo('icinga-snapshot-builds') } it { is_expected.not_to contain_yumrepo('powertools') } + it { is_expected.not_to contain_yumrepo('crb') } if facts[:os]['name'] == 'Fedora' || facts[:os]['name'] == 'OracleLinux' it { is_expected.not_to contain_yumrepo('epel').with('enabled' => 1) } @@ -91,8 +92,8 @@ it { is_expected.not_to contain_yumrepo('powertools') } end - context 'with manage_epel => true, manage_powertools => true' do - let(:params) { { manage_epel: true, manage_powertools: true } } + context 'with manage_epel => true, manage_powertools => true, manage_crb => true' do + let(:params) { { manage_epel: true, manage_powertools: true, manage_crb: true } } if facts[:os]['name'] == 'Fedora' || facts[:os]['name'] == 'OracleLinux' it { is_expected.not_to contain_yumrepo('epel') } @@ -101,8 +102,12 @@ it { is_expected.to contain_yumrepo('epel').with('enabled' => 1) } end - if facts[:os]['name'] == 'CentOS' && Integer(facts[:os]['release']['major']) > 7 - it { is_expected.to contain_yumrepo('powertools').with('enabled' => 1) } + if facts[:os]['name'] == 'CentOS' + if Integer(facts[:os]['release']['major']) == 8 + it { is_expected.to contain_yumrepo('powertools').with('enabled' => 1) } + elsif Integer(facts[:os]['release']['major']) > 8 + it { is_expected.to contain_yumrepo('crb').with('enabled' => 1) } + end end end