Skip to content

Commit

Permalink
packaging: Add KeycloakEnv.SUPPORTED
Browse files Browse the repository at this point in the history
Allow setup code to decide/know if Keycloak integration is
supported. Set as unsupported for RHV.

Change-Id: I5ec0fee15cc761238989afaec55db9a5aa831778
Signed-off-by: Yedidyah Bar David <didi@redhat.com>
  • Loading branch information
didib committed Jun 7, 2022
1 parent 3570a48 commit c20976c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ovirt-engine.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,14 @@ OVESETUP_CONFIG/jbossHome=str:/opt/rh/eap7/root/usr/share/wildfly
OVESETUP_CONFIG/pkiRenewalDocUrl=str:https://access.redhat.com/solutions/1572983
__EOF__

# Disable automatic keycloak integration in RHV.
# Manual integration is possible and documented at ???
# TODO: Provide a link. I found this, but think there are probably better ones:
# https://www.redhat.com/en/blog/red-hat-it-single-sign-onsso-runs-red-hat-virtualization
cat >> "%{buildroot}%{_sysconfdir}/ovirt-engine-setup.conf.d/10-packaging.conf" << __EOF__
OVESETUP_CONFIG/keycloakSupported=bool:False
__EOF__

cat > "%{buildroot}%{_sysconfdir}/ovirt-engine-setup.conf.d/10-packaging-wsp.conf" << __EOF__
[environment:default]
__EOF__
Expand Down
2 changes: 2 additions & 0 deletions packaging/setup/ovirt_engine_setup/engine_common/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,8 @@ class KeycloakEnv(object):
def ENABLE(self):
return 'OVESETUP_CONFIG/keycloakEnable'

SUPPORTED = 'OVESETUP_CONFIG/keycloakSupported'

@osetupattrs(
is_secret=True,
answerfile=True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ def _generatePassword():
def __init__(self, context):
super(Plugin, self).__init__(context=context)

@plugin.event(
stage=plugin.Stages.STAGE_BOOT,
)
def _boot(self):
self.environment.setdefault(
oengcommcons.KeycloakEnv.SUPPORTED,
False
)

@plugin.event(
stage=plugin.Stages.STAGE_INIT,
)
Expand Down Expand Up @@ -86,6 +95,15 @@ def _init(self):
False
)

@plugin.event(
stage=plugin.Stages.STAGE_SETUP,
condition=lambda self: not self.environment[
oengcommcons.KeycloakEnv.SUPPORTED
],
)
def _setup(self):
self.environment[oengcommcons.KeycloakEnv.ENABLE] = False

@plugin.event(
stage=plugin.Stages.STAGE_CUSTOMIZATION,
name=oengcommcons.Stages.ADMIN_PASSWORD_SET,
Expand Down

0 comments on commit c20976c

Please sign in to comment.