From 7a989f777187f09c8946d4514e19405f41c0b4fe Mon Sep 17 00:00:00 2001 From: Guido Grazioli Date: Fri, 14 Jan 2022 10:06:43 +0100 Subject: [PATCH 1/4] Move former templates and update docs --- roles/keycloak/README.md | 8 ++++++++ roles/keycloak/defaults/main.yml | 2 +- .../templates/{ => 9.0.2}/standalone-infinispan.xml.j2 | 0 roles/keycloak/templates/{ => 9.0.2}/standalone.xml.j2 | 0 4 files changed, 9 insertions(+), 1 deletion(-) rename roles/keycloak/templates/{ => 9.0.2}/standalone-infinispan.xml.j2 (100%) rename roles/keycloak/templates/{ => 9.0.2}/standalone.xml.j2 (100%) diff --git a/roles/keycloak/README.md b/roles/keycloak/README.md index 745c5d3..a89320a 100644 --- a/roles/keycloak/README.md +++ b/roles/keycloak/README.md @@ -13,6 +13,14 @@ This role requires the `python3-netaddr` library installed on the controller nod * or via pip: `pip install netaddr==0.8.0` +Versions +-------- + +| RH-SSO VERSION | Release Date | Keycloak Version | EAP Version | Notes | +|:---------------|:------------------|:-----------------|:------------|:----------------| +|`7.5.0 GA` |September 20, 2021 |`15.0.2` | `7.4.0` |[Release Notes](https://access.redhat.com/documentation/en-us/red_hat_single_sign-on/7.5/html/release_notes/index)| + + Role Defaults ------------- diff --git a/roles/keycloak/defaults/main.yml b/roles/keycloak/defaults/main.yml index a75fc70..5046fb4 100644 --- a/roles/keycloak/defaults/main.yml +++ b/roles/keycloak/defaults/main.yml @@ -1,6 +1,6 @@ --- ### Configuration specific to keycloak -keycloak_version: 9.0.2 +keycloak_version: 15.0.2 keycloak_archive: keycloak-{{ keycloak_version }}.zip keycloak_download_url: https://downloads.jboss.org/keycloak/{{ keycloak_version }}/{{ keycloak_archive }} keycloak_installdir: "{{ keycloak_dest }}/keycloak-{{ keycloak_version }}" diff --git a/roles/keycloak/templates/standalone-infinispan.xml.j2 b/roles/keycloak/templates/9.0.2/standalone-infinispan.xml.j2 similarity index 100% rename from roles/keycloak/templates/standalone-infinispan.xml.j2 rename to roles/keycloak/templates/9.0.2/standalone-infinispan.xml.j2 diff --git a/roles/keycloak/templates/standalone.xml.j2 b/roles/keycloak/templates/9.0.2/standalone.xml.j2 similarity index 100% rename from roles/keycloak/templates/standalone.xml.j2 rename to roles/keycloak/templates/9.0.2/standalone.xml.j2 From 94aecfcd87f2ffc0f3c3f75aafda54a05d494d73 Mon Sep 17 00:00:00 2001 From: Guido Grazioli Date: Fri, 14 Jan 2022 10:09:10 +0100 Subject: [PATCH 2/4] Rename/merge templates and update install task --- roles/keycloak/tasks/install.yml | 4 ++-- ...andalone-rhsso-jdg.xml.j2 => standalone-infinispan.xml.j2} | 0 .../templates/{standalone-rhsso.xml.j2 => standalone.xml.j2} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename roles/keycloak/templates/{standalone-rhsso-jdg.xml.j2 => standalone-infinispan.xml.j2} (100%) rename roles/keycloak/templates/{standalone-rhsso.xml.j2 => standalone.xml.j2} (100%) diff --git a/roles/keycloak/tasks/install.yml b/roles/keycloak/tasks/install.yml index 88a0ab4..3044347 100644 --- a/roles/keycloak/tasks/install.yml +++ b/roles/keycloak/tasks/install.yml @@ -129,7 +129,7 @@ - name: "Deploy Keycloak's standalone.xml" become: yes template: - src: "{{ 'templates/standalone-rhsso.xml.j2' if keycloak_rhsso_enable else 'templates/standalone.xml.j2' }}" + src: templates/standalone.xml.j2 dest: "{{ keycloak_config_path_to_standalone_xml }}" owner: "{{ keycloak_service_user }}" group: "{{ keycloak_service_group }}" @@ -141,7 +141,7 @@ - name: "Deploy Keycloak's standalone.xml with remote cache store" become: yes template: - src: "{{ 'templates/standalone-rhsso-jdg.xml.j2' if keycloak_rhsso_enable else 'templates/standalone-infinispan.xml.j2' }}" + src: templates/standalone-infinispan.xml.j2 dest: "{{ keycloak_config_path_to_standalone_xml }}" owner: "{{ keycloak_service_user }}" group: "{{ keycloak_service_group }}" diff --git a/roles/keycloak/templates/standalone-rhsso-jdg.xml.j2 b/roles/keycloak/templates/standalone-infinispan.xml.j2 similarity index 100% rename from roles/keycloak/templates/standalone-rhsso-jdg.xml.j2 rename to roles/keycloak/templates/standalone-infinispan.xml.j2 diff --git a/roles/keycloak/templates/standalone-rhsso.xml.j2 b/roles/keycloak/templates/standalone.xml.j2 similarity index 100% rename from roles/keycloak/templates/standalone-rhsso.xml.j2 rename to roles/keycloak/templates/standalone.xml.j2 From d7597771cfe777d78b3d68e4915217a0c2fcbfd3 Mon Sep 17 00:00:00 2001 From: Guido Grazioli Date: Fri, 14 Jan 2022 10:14:24 +0100 Subject: [PATCH 3/4] Drop service logfile, symlink log directory instead --- roles/keycloak/tasks/main.yml | 12 ++++++++++-- roles/keycloak/templates/keycloak-service.sh.j2 | 3 +-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/roles/keycloak/tasks/main.yml b/roles/keycloak/tasks/main.yml index 66f56b3..bcf0c06 100644 --- a/roles/keycloak/tasks/main.yml +++ b/roles/keycloak/tasks/main.yml @@ -6,9 +6,17 @@ tags: - prereqs -- include_tasks: tasks/install.yml +- name: Include install tasks + include_tasks: tasks/install.yml -- include_tasks: tasks/systemd.yml +- name: Include systemd tasks + include_tasks: tasks/systemd.yml + +- name: Link default logs directory + file: + state: link + src: "{{keycloak_jboss_home}}/standalone/log" + dest: /var/log/keycloak - block: - name: Check admin credentials by generating a token diff --git a/roles/keycloak/templates/keycloak-service.sh.j2 b/roles/keycloak/templates/keycloak-service.sh.j2 index 422ccde..82e3a21 100755 --- a/roles/keycloak/templates/keycloak-service.sh.j2 +++ b/roles/keycloak/templates/keycloak-service.sh.j2 @@ -83,8 +83,7 @@ startKeycloak() { -Djboss.management.https.port=${KEYCLOAK_MANAGEMENT_HTTPS_PORT} \ -Djboss.node.name={{ inventory_hostname }} \ {% if keycloak_prefer_ipv4 %}-Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses=true {% endif %}\ - {% if keycloak_config_standalone_xml is defined %}--server-config={{ keycloak_config_standalone_xml }}{% endif %} \ - 2>&1 >> "${KEYCLOAK_LOGFILE}" & + {% if keycloak_config_standalone_xml is defined %}--server-config={{ keycloak_config_standalone_xml }}{% endif %} & while [ ! -f ${KEYCLOAK_PIDFILE} ]; do sleep 1; done fi } From d4634fcebc84959d72db11a6f64aaf2cb14e31d8 Mon Sep 17 00:00:00 2001 From: Guido Grazioli Date: Fri, 14 Jan 2022 10:29:48 +0100 Subject: [PATCH 4/4] update new download location --- molecule/default/molecule.yml | 2 +- molecule/default/prepare.yml | 2 ++ roles/keycloak/defaults/main.yml | 7 ++++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index c59579c..68adf70 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -3,7 +3,7 @@ dependency: name: shell command: ansible-galaxy collection install -r molecule/default/requirements.yml -p $HOME/.ansible/collections --force-with-deps driver: - name: podman + name: docker platforms: - name: instance image: registry.access.redhat.com/ubi8/ubi-init:latest diff --git a/molecule/default/prepare.yml b/molecule/default/prepare.yml index 425c16d..8dbc48d 100644 --- a/molecule/default/prepare.yml +++ b/molecule/default/prepare.yml @@ -4,6 +4,8 @@ tasks: - name: Disable beta repos command: yum config-manager --disable '*beta*' + ignore_errors: yes + - name: Install sudo yum: name: sudo diff --git a/roles/keycloak/defaults/main.yml b/roles/keycloak/defaults/main.yml index 5046fb4..1baf784 100644 --- a/roles/keycloak/defaults/main.yml +++ b/roles/keycloak/defaults/main.yml @@ -1,14 +1,15 @@ --- ### Configuration specific to keycloak keycloak_version: 15.0.2 -keycloak_archive: keycloak-{{ keycloak_version }}.zip -keycloak_download_url: https://downloads.jboss.org/keycloak/{{ keycloak_version }}/{{ keycloak_archive }} +keycloak_archive: "keycloak-{{ keycloak_version }}.zip" +keycloak_download_url: "https://github.com/keycloak/keycloak/releases/download/{{ keycloak_version }}/{{ keycloak_archive }}" +keycloak_download_url_9x: "https://downloads.jboss.org/keycloak/{{ keycloak_version }}/{{ keycloak_archive }}" keycloak_installdir: "{{ keycloak_dest }}/keycloak-{{ keycloak_version }}" ### Configuration specific to Red Hat Single Sing-On keycloak_rhsso_enable: "{{ True if rhsso_rhn_id is defined else False }}" keycloak_rhsso_version: 7.5 -keycloak_rhsso_archive: rh-sso-{{ keycloak_rhsso_version }}-server-dist.zip +keycloak_rhsso_archive: "rh-sso-{{ keycloak_rhsso_version }}-server-dist.zip" keycloak_rhsso_installdir: "{{ keycloak_dest }}/rh-sso-{{ keycloak_rhsso_version }}" keycloak_rhsso_base_url: 'https://access.redhat.com/jbossnetwork/restricted/softwareDownload.html?softwareId='