-
Notifications
You must be signed in to change notification settings - Fork 20
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
try to use the fqdn for pulpcore urls #43
base: master
Are you sure you want to change the base?
Conversation
fba32c8
to
89b99ed
Compare
Those URLs are used by Katello and clients to connect to Pulp and `localhost` is almost never the right choice here as it will be either not reachable (for clients) or have the wrong certs (for Katello). Try to obtain the FQDN of the system from Facter, if available and fall back to `Socket.gethostname` (which is not guaranteed to return a FQDN) otherwise.
fqdn = begin | ||
require 'facter' | ||
Facter.fact('networking.fqdn').value | ||
rescue StandardError, LoadError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL that LoadError
is not a StandardError
…
These defaults are sort of development values. and I always assumed people would set this explicitly because I don't trust autodetection. |
I think the only way to enforce that is to not have a default value and ensure users think about / set this value. I would tend to prefer no default value other than a default specified in the settings file. |
If there is no sane default, don't have one in the first place. That makes a lot of sense to me. |
I guess the sanity is debatable, yeah. Would y'all prefer if I'd just drop the localhost default values, and mark the settings as required? |
Works for me. Saves doing these lookups regardless of whether a setting is configured (which can fail or slow things down) |
Those URLs are used by Katello and clients to connect to Pulp and
localhost
is almost never the right choice here as it will be eithernot reachable (for clients) or have the wrong certs (for Katello).
Try to obtain the FQDN of the system from Facter, if available and fall
back to
Socket.gethostname
(which is not guaranteed to return a FQDN)otherwise.