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

Factor out Apache to its own class #888

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ekohl
Copy link
Member

@ekohl ekohl commented Oct 10, 2020

Prior to this, when the Apache config was modified a full database refresh was triggered. There's no need for that and this makes applying those changes faster.

I found this while making the Pulpcore changes and this held me up. For now it's untested but pushing this allows me to test it out. Until then it's a draft.

Stdlib::IP::Address::V6 => "[${foreman::foreman_service_bind}]:${foreman::foreman_service_port}",
default => "${foreman::foreman_service_bind}:${foreman::foreman_service_port}",
}

if $foreman::use_foreman_service {
Copy link
Member

Choose a reason for hiding this comment

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

Is there a best practice as to why this section does not live in service.pp since they are tied to the service itself?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think initially when I wrote this I considered them config files. Now looking back (and with the experiences from Pulpcore as well) I think service.pp would be a better place. For example, there's no reason this needs to be done before the DB, apache etc.

keycloak_app_name => $foreman::keycloak_app_name,
keycloak_realm => $foreman::keycloak_realm,
if $foreman::apache and $foreman::ipa_authentication {
unless fact('foreman_ipa.default_server') and fact('foreman_ipa.default_realm') {
Copy link
Member

Choose a reason for hiding this comment

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

Not for this change, but I would have us consider putting external auth into it's own class for slimming down the config class and making it more obvious what aspects are tied to external auth.

Copy link
Member Author

Choose a reason for hiding this comment

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

Probably, there's more room for improvement and I think I scratched the surface here.

@@ -0,0 +1,65 @@
# @summary The apache configuration for Foreman
# @api private
class foreman::apache {
Copy link
Member

Choose a reason for hiding this comment

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

👍 I like this being a clear, dedicated class

@ekohl
Copy link
Member Author

ekohl commented Apr 6, 2021

I'll revisit this once we've decided on dropping mod_passenger.

ekohl added 2 commits July 9, 2021 15:29
ipa-getkeytab can figure out the default server on its own[1]. There is no
need to specify it and can even break things. For example, DNS can be
used to detect servers. Then the fact is empty and it fails while the
command would actually pass.

The foreman_ipa fact is removed since it's a major version bump anyway
and nothing else should use our foreman_ipa fact.

[1] theforeman#880 (comment)
Prior to this, when the Apache config was modified a full database
refresh was triggered. There's no need for that and this makes applying
those changes faster.
@ekohl ekohl force-pushed the prevent-db-reload-on-apache branch from 63813ca to 8d9a6f1 Compare July 9, 2021 16:21
@ekohl
Copy link
Member Author

ekohl commented Jul 9, 2021

Since we've dropped mod_passenger for a while, I've rebased this. It includes #935

@ehelms
Copy link
Member

ehelms commented Jul 13, 2021

Can now be rebased again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants