Enable features in quarkus
SUMMARY
As in #274 it would be very handy if there would be a way to simply enable features, like in the legacy Keycloak playbook.
ISSUE TYPE
- Features can't be enabled in current Keycloak Quarkus playbook
@fxwgr, so you want to enable the mentioned feature using a variable? just like keycloak_ha_enabled? Am I thinking it correctly?
@RanabirChakraborty for me it would be sufficient to have an variable like in the previously mentioned Keycloak legacy role keycloak_features: [ { name: 'docker', status: 'enabled' } ]
You can still define enabled/disabled feature using the parameter keycloak_quarkus_additional_env_vars (list), like here:
keycloak_quarkus_additional_env_vars:
- key: KC_FEATURES
value: clusterless
- key: KC_FEATURES_DISABLED
value: persistent-user-sessions,kerberos
We could add a parameter for features alone, but it would require a rather complex validation for additional env vars. @hwo-wd wdyt?
@guidograzioli great, thanks, I just tried KC_FEATURES_ENABLED and it didn't work, so I thought this option is missing.
BTW: Is there a complete list of available env vars? Couldn't find such information in the quarkus role readme.
As you can see we already use the feature extensively in the CI tests:
https://github.com/ansible-middleware/keycloak/blob/main/molecule/quarkus/converge.yml#L28 https://github.com/ansible-middleware/keycloak/blob/main/molecule/quarkus_ha_remote/converge.yml#L51
For the list of envvars read by keycloak, please refer to the keycloak.org documentation. The list of role parameters for the keycloak_quarkus role is documented in the role README [1], and in argument_specs [2]
[1] https://github.com/ansible-middleware/keycloak/blob/main/roles/keycloak_quarkus/README.md [2] https://github.com/ansible-middleware/keycloak/blob/main/roles/keycloak_quarkus/meta/argument_specs.yml
You can still define enabled/disabled feature using the parameter
keycloak_quarkus_additional_env_vars(list), like here:keycloak_quarkus_additional_env_vars: - key: KC_FEATURES value: clusterless - key: KC_FEATURES_DISABLED value: persistent-user-sessions,kerberosWe could add a parameter for features alone, but it would require a rather complex validation for additional env vars. @hwo-wd wdyt?
complex validation as in:
- check if
keycloak_quarkus_features(or similar) is set by user AND contained inkeycloak_quarkus_additional_env_varsand, if so:- merge them?
- throw error? <- especially this would break downwards compatibility
from my standpoint I would keep the way it is, it's also the way to go for helm charts etc.