Skip to content

Commit

Permalink
Add facts_match_regex paramter in katello class
Browse files Browse the repository at this point in the history
  • Loading branch information
archanaserver authored and ehelms committed Jun 27, 2024
1 parent f3be87a commit e057cf3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
4 changes: 4 additions & 0 deletions manifests/candlepin.pp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
# Artemis. It should still be signed by the correct Certificate Authority.
# @param loggers
# Configure the Candlepin loggers
# @param facts_match_regex
# Configure the Candlepin facts_match_regex
class katello::candlepin (
Stdlib::Host $db_host = 'localhost',
Optional[Stdlib::Port] $db_port = undef,
Expand All @@ -36,6 +38,7 @@
Boolean $manage_db = true,
Variant[Undef, Deferred, String[1]] $artemis_client_dn = undef,
Hash[String[1], Candlepin::LogLevel] $loggers = {},
Optional[String[1]] $facts_match_regex = undef,
) {
include certs
include katello::params
Expand Down Expand Up @@ -73,6 +76,7 @@
db_ssl_ca => $db_ssl_ca,
manage_db => $manage_db,
loggers => $loggers,
facts_match_regex => $facts_match_regex,
subscribe => Class['certs', 'certs::candlepin'],
} ->
anchor { 'katello::candlepin': } # lint:ignore:anchor_resource
Expand Down
6 changes: 4 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@
#
# $candlepin_loggers:: Configure the Candlepin loggers
#
# $candlepin_facts_match_regex:: Configure the Candlepin facts_match_regex
#
# $rest_client_timeout:: Timeout for Katello rest API
#
# $hosts_queue_workers:: Configures the number of workers handling the hosts_queue queue.
#
class katello (
Optional[String] $candlepin_oauth_key = undef,
Optional[String] $candlepin_oauth_secret = undef,

Integer[0] $rest_client_timeout = 3600,

String $candlepin_db_host = 'localhost',
Optional[Stdlib::Port] $candlepin_db_port = undef,
String $candlepin_db_name = 'candlepin',
Expand All @@ -51,6 +51,7 @@
Optional[Stdlib::Absolutepath] $candlepin_db_ssl_ca = undef,
Boolean $candlepin_manage_db = true,
Hash[String[1], Candlepin::LogLevel] $candlepin_loggers = {},
Optional[String[1]] $candlepin_facts_match_regex = undef,

Integer[0] $hosts_queue_workers = 1,
) {
Expand Down Expand Up @@ -82,5 +83,6 @@
manage_db => $candlepin_manage_db,
artemis_client_dn => $katello::application::artemis_client_dn,
loggers => $candlepin_loggers,
facts_match_regex => $candlepin_facts_match_regex,
}
}
10 changes: 10 additions & 0 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@
it { is_expected.to contain_class('katello::application') }
it { is_expected.to contain_package('rubygem-katello').that_requires('Class[candlepin]') }
it { is_expected.to contain_package('katello') }

context 'with facts_match_regex' do
let(:params) { { candlepin_facts_match_regex: 'test_match_regex' } }

it { is_expected.to compile.with_all_deps }

it 'should pass the facts_match_regex parameter to katello::candlepin' do
is_expected.to contain_class('katello::candlepin').with_facts_match_regex('test_match_regex')
end
end
end
end
end

0 comments on commit e057cf3

Please sign in to comment.