ansible-middleware / keycloak

Collection to install and configure Keycloak or Red Hat Single Sign-On / Red Hat Build of Keycloak
Apache License 2.0
82 stars 49 forks source link

Allow for custom providers hosted on maven repositories #223

Closed hwo-wd closed 2 weeks ago

hwo-wd commented 2 weeks ago

Extends support for custom providers ("SPIs"): while previously only http downloads were supported, the new provider definition allows for maven downloads (e.g., Apache Maven Central, Github Apache Maven (requires authn via a PAT)).

The new providers definition looks like:

keycloak_quarkus_providers:
  - id: http-client                         # required
    spi: connections                        # required if url is not specified
  - id: http-client                         # required; "{{ id }}.jar" identifies the file name on RHBK
    spi: connections                        # required if neither url, local_path nor maven are specified; required for setting properties
    default: true                           # optional, whether to set default for spi, default false
    restart: true                           # optional, whether to restart, default true
    url: https://.../.../custom_spi.jar     # optional, url for download
    url: https://.../.../custom_spi.jar     # optional, url for download via http
    local_path: my_theme_spi.jar            # optional, path on local controller for SPI to be uploaded
    maven:                                  # optional, for download using maven
      repository_url: https://maven.pkg.github.com/OWNER/REPOSITORY # optional, maven repo url
      group_id:  my.group                   # optional, maven group id
      artifact_id: artifact                 # optional, maven artifact id
      version: 24.0.4                       # optional, defaults to latest
      username:  user                       # optional, cf. https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry#authenticating-to-github-packages
      password: pat                         # optional, provide a PAT for accessing Github's Apache Maven registry
    properties:                             # optional, list of key-values

Close #222

hwo-wd commented 2 weeks ago

We now support three different kinds of providers:

I think this pretty much covers the majority of use cases; future improvements might be: