ansible-middleware/keycloak

keycloak: Template folder is no longer available for newer versions of Keycloak

Closed this issue · 2 comments

SUMMARY

When adding the keycloak role for installing the version 22.0.5 in a playbook, an error is thrown due to the missing folder for templates that would contain the configuration for the standalone server.

Reviewing the content of the zip file downloaded, the newer version of keycloak does not contain the template folder for the configuration, it does not use the xml files for configuring the server.

ISSUE TYPE
  • Bug Report
ANSIBLE VERSION
➜ ansible --version                                                       
ansible [core 2.15.5]
  config file = /Users/ansible/ansible.cfg
  configured module search path = ['/Users/ansible/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/ansible/.virtualenvs/ansible/lib/python3.10/site-packages/ansible
  ansible collection location = /Users/ansible/.ansible/collections:/usr/share/ansible/collections
  executable location = /Users/ansible/.virtualenvs/ansible/bin/ansible
  python version = 3.10.6 (main, Sep  2 2022, 16:29:31) [Clang 13.1.6 (clang-1316.0.21.2.5)] (/Users/ansible/.virtualenvs/ansible/bin/python)
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION
Collection                     Version
------------------------------ -------
middleware_automation.common   1.1.4  
middleware_automation.keycloak 1.3.0 
STEPS TO REPRODUCE
  tasks:
    - name: Include keycloak role for installation
      include_role:
        name: keycloak
      vars:
        keycloak_version: 22.0.5
        keycloak_archive: "keycloak-{{ keycloak_version }}.tar.gz"
        keycloak_admin_password: "remembertochangeme"
        keycloak_ha_enabled: True
        # keycloak_remote_cache_enabled: False
        # keycloak_config_override_template: ''
      tags:
        - kc
EXPECTED RESULTS

I expect that the installer continues the configuration without the template, since the newer version of keycloak works directly by executing the script that runs the server

ACTUAL RESULTS
TASK [middleware_automation.keycloak.keycloak : Deploy HA keycloak config with infinispan remote cache store to /opt/keycloak/keycloak-22.0.5/standalone/configuration/keycloak.xml] ***
fatal: [default]: FAILED! => {"changed": false, "checksum": "2e2dba94996eff3c7d3de307739275cf90e383b1", "msg": "Destination directory /opt/keycloak/keycloak-22.0.5/standalone/configuration does not exist"}

Hello; the keycloak role is supposed to be used for keycloak-legacy (keycloak based on wildfly), up to version 19. For keycloak.x current distributions, you need to use the keycloak_quarkus role instead.

ok, thanks, great to know!