Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add facts_match_regex parameter in katello class #498

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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: 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
Loading