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

Refs #28922: Communicate via localhost to Candlepin #321

Merged
merged 1 commit into from
Mar 4, 2020
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
6 changes: 5 additions & 1 deletion manifests/candlepin.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@
Boolean $manage_db = true,
) {
include certs
include certs::candlepin
include katello::params

class { 'certs::candlepin':
hostname => $katello::params::candlepin_host,
}

Anchor <| title == 'katello::qpid::event_queue' |> ->
class { 'candlepin':
host => $katello::params::candlepin_host,
user_groups => $certs::candlepin::group,
oauth_key => $katello::params::candlepin_oauth_key,
oauth_secret => $katello::params::candlepin_oauth_secret,
Expand Down
5 changes: 4 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
# This is a reversed model compared to the "regular" globals, but the
# parameters on globals are reserved for the foreman-installer
#
# @param candlepin_host
# The host to run Candlepin as
# @param candlepin_url
# The URL to connect to Candlepin
# @param pulp_url
Expand All @@ -21,11 +23,12 @@
# @param candlepin_oauth_secret
# The oauth secret for Candlepin
class katello::params (
Stdlib::Httpsurl $candlepin_url = "https://${facts['fqdn']}:8443/candlepin",
Stdlib::Httpsurl $pulp_url = "https://${facts['fqdn']}/pulp/api/v2/",
Stdlib::Httpsurl $crane_url = "https://${facts['fqdn']}:5000",
Stdlib::Host $qpid_hostname = 'localhost',
String[1] $candlepin_oauth_key = $katello::globals::candlepin_oauth_key,
String[1] $candlepin_oauth_secret = $katello::globals::candlepin_oauth_secret,
Stdlib::Host $candlepin_host = 'localhost',
Stdlib::Httpsurl $candlepin_url = "https://${candlepin_host}:8443/candlepin"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if this works. I've seen people use it, but never trusted it. Given this is the only way to deploy candlepin, I'd move the $candlepin_url part to the body of this class.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This worked in my testing running these changes live with the installer. If its defined in the body, will other modules be able to access it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that still works.

) inherits katello::globals {
}
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
{
"name": "katello/candlepin",
"version_requirement": ">= 4.0.0 < 10.0.0"
"version_requirement": ">= 9.0.0 < 10.0.0"
},
{
"name": "katello/certs",
Expand Down
6 changes: 3 additions & 3 deletions spec/classes/application_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class { 'katello::params':
' :docker: true',
' :ostree: false',
' :candlepin:',
' :url: https://foo.example.com:8443/candlepin',
' :url: https://localhost:8443/candlepin',
' :oauth_key: "katello"',
' :oauth_secret: "candlepin-secret"',
' :ca_cert_file: /etc/pki/katello/certs/katello-default-ca.crt',
Expand Down Expand Up @@ -129,7 +129,7 @@ class { 'katello::params':
' :docker: true',
' :ostree: false',
' :candlepin:',
' :url: https://foo.example.com:8443/candlepin',
' :url: https://localhost:8443/candlepin',
' :oauth_key: "katello"',
' :oauth_secret: "candlepin-secret"',
' :ca_cert_file: /etc/pki/katello/certs/katello-default-ca.crt',
Expand Down Expand Up @@ -173,7 +173,7 @@ class {'katello::globals':
' :docker: true',
' :ostree: true',
' :candlepin:',
' :url: https://foo.example.com:8443/candlepin',
' :url: https://localhost:8443/candlepin',
' :oauth_key: "katello"',
' :oauth_secret: "candlepin-secret"',
' :ca_cert_file: /etc/pki/katello/certs/katello-default-ca.crt',
Expand Down