mirror of
https://github.com/ansible-middleware/keycloak.git
synced 2025-04-05 02:10:29 -07:00
Fix molecule tests
This commit is contained in:
parent
e029e1c2fd
commit
86284b12c2
24 changed files with 49 additions and 27 deletions
|
@ -5,14 +5,17 @@
|
|||
keycloak_quarkus_show_deprecation_warnings: false
|
||||
keycloak_quarkus_bootstrap_admin_password: "remembertochangeme"
|
||||
keycloak_quarkus_bootstrap_admin_user: "remembertochangeme"
|
||||
keycloak_quarkus_hostname: http://instance
|
||||
keycloak_quarkus_hostname: http://instance:8080
|
||||
keycloak_quarkus_log: file
|
||||
keycloak_quarkus_start_dev: true
|
||||
keycloak_quarkus_proxy_mode: none
|
||||
roles:
|
||||
- role: keycloak_quarkus
|
||||
- role: keycloak_realm
|
||||
keycloak_url: "{{ keycloak_quarkus_hostname }}"
|
||||
keycloak_context: ''
|
||||
keycloak_admin_user: "{{ keycloak_quarkus_bootstrap_admin_user }}"
|
||||
keycloak_admin_password: "{{ keycloak_quarkus_bootstrap_admin_password }}"
|
||||
keycloak_client_users:
|
||||
- username: TestUser
|
||||
password: password
|
||||
|
|
|
@ -7,5 +7,6 @@
|
|||
ansible.builtin.apt:
|
||||
name:
|
||||
- sudo
|
||||
# - openjdk-21-jdk-headless # this is not available in ghcr.io/hspaans/molecule-containers:debian-11 (neither in debian-12) since the images are using outdated package sources
|
||||
- openjdk-17-jdk-headless
|
||||
state: present
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
keycloak_quarkus_show_deprecation_warnings: false
|
||||
keycloak_quarkus_bootstrap_admin_password: "remembertochangeme"
|
||||
keycloak_quarkus_bootstrap_admin_user: "remembertochangeme"
|
||||
keycloak_quarkus_hostname: http://instance
|
||||
keycloak_quarkus_hostname: http://instance:8080
|
||||
keycloak_quarkus_log: file
|
||||
keycloak_quarkus_log_level: debug
|
||||
keycloak_quarkus_log_target: /tmp/keycloak
|
||||
|
@ -16,7 +16,10 @@
|
|||
roles:
|
||||
- role: keycloak_quarkus
|
||||
- role: keycloak_realm
|
||||
keycloak_url: "{{ keycloak_quarkus_hostname }}"
|
||||
keycloak_context: ''
|
||||
keycloak_admin_user: "{{ keycloak_quarkus_bootstrap_admin_user }}"
|
||||
keycloak_admin_password: "{{ keycloak_quarkus_bootstrap_admin_password }}"
|
||||
keycloak_client_users:
|
||||
- username: TestUser
|
||||
password: password
|
||||
|
|
|
@ -11,6 +11,7 @@ platforms:
|
|||
- "8080/tcp"
|
||||
- "8443/tcp"
|
||||
- "8009/tcp"
|
||||
- "9000/tcp"
|
||||
provisioner:
|
||||
name: ansible
|
||||
config_options:
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
- name: Download keycloak archive to controller directory
|
||||
ansible.builtin.get_url: # noqa risky-file-permissions delegated, uses controller host user
|
||||
url: https://github.com/keycloak/keycloak/releases/download/24.0.5/keycloak-24.0.5.zip
|
||||
url: https://github.com/keycloak/keycloak/releases/download/26.0.7/keycloak-26.0.7.zip
|
||||
dest: /tmp/keycloak
|
||||
mode: '0640'
|
||||
delegate_to: localhost
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
- name: Verify
|
||||
hosts: all
|
||||
vars:
|
||||
keycloak_quarkus_bootstrap_admin_password: "remembertochangeme"
|
||||
keycloak_quarkus_bootstrap_admin_user: "remembertochangeme"
|
||||
keycloak_uri: "http://localhost:8080"
|
||||
tasks:
|
||||
|
@ -16,7 +17,7 @@
|
|||
ansible.builtin.uri:
|
||||
url: "{{ keycloak_uri }}/realms/master/protocol/openid-connect/token"
|
||||
method: POST
|
||||
body: "client_id=admin-cli&username=admin&password={{ keycloak_quarkus_bootstrap_admin_user }}&grant_type=password"
|
||||
body: "client_id=admin-cli&username={{ keycloak_quarkus_bootstrap_admin_user }}&password={{ keycloak_quarkus_bootstrap_admin_user }}&grant_type=password"
|
||||
validate_certs: no
|
||||
register: keycloak_auth_response
|
||||
until: keycloak_auth_response.status == 200
|
||||
|
|
|
@ -5,13 +5,12 @@
|
|||
keycloak_quarkus_show_deprecation_warnings: false
|
||||
keycloak_quarkus_bootstrap_admin_password: "remembertochangeme"
|
||||
keycloak_quarkus_bootstrap_admin_user: "remembertochangeme"
|
||||
keycloak_realm: TestRealm
|
||||
keycloak_quarkus_hostname: http://instance
|
||||
keycloak_quarkus_hostname: https://proxy
|
||||
keycloak_quarkus_log: file
|
||||
keycloak_quarkus_http_enabled: True
|
||||
keycloak_quarkus_http_port: 8080
|
||||
keycloak_quarkus_proxy_mode: edge
|
||||
keycloak_quarkus_http_relative_path: /
|
||||
keycloak_quarkus_frontend_url: https://proxy/
|
||||
keycloak_quarkus_health_check_url: http://proxy:8080/realms/master/.well-known/openid-configuration
|
||||
roles:
|
||||
- role: keycloak_quarkus
|
||||
|
|
|
@ -11,6 +11,7 @@ platforms:
|
|||
- "8080/tcp"
|
||||
- "8443/tcp"
|
||||
- "8009/tcp"
|
||||
- "9000/tcp"
|
||||
provisioner:
|
||||
name: ansible
|
||||
config_options:
|
||||
|
|
|
@ -7,14 +7,17 @@
|
|||
keycloak_quarkus_bootstrap_admin_user: "remembertochangeme"
|
||||
keycloak_realm: TestRealm
|
||||
keycloak_quarkus_log: file
|
||||
keycloak_quarkus_frontend_url: 'http://localhost:8080/'
|
||||
keycloak_quarkus_hostname: 'http://localhost:8080'
|
||||
keycloak_quarkus_start_dev: True
|
||||
keycloak_quarkus_proxy_mode: none
|
||||
keycloak_quarkus_java_home: /opt/openjdk/
|
||||
roles:
|
||||
- role: keycloak_quarkus
|
||||
- role: keycloak_realm
|
||||
keycloak_url: "{{ keycloak_quarkus_hostname }}"
|
||||
keycloak_context: ''
|
||||
keycloak_admin_user: "{{ keycloak_quarkus_bootstrap_admin_user }}"
|
||||
keycloak_admin_password: "{{ keycloak_quarkus_bootstrap_admin_password }}"
|
||||
keycloak_client_default_roles:
|
||||
- TestRoleAdmin
|
||||
- TestRoleUser
|
||||
|
|
|
@ -10,8 +10,10 @@ platforms:
|
|||
port_bindings:
|
||||
- "8080/tcp"
|
||||
- "8009/tcp"
|
||||
- "9000/tcp"
|
||||
published_ports:
|
||||
- 0.0.0.0:8080:8080/tcp
|
||||
- 0.0.0.0:9000:9000/TCP
|
||||
provisioner:
|
||||
name: ansible
|
||||
config_options:
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
keycloak_quarkus_bootstrap_admin_password: "remembertochangeme"
|
||||
keycloak_quarkus_bootstrap_admin_user: "remembertochangeme"
|
||||
keycloak_realm: TestRealm
|
||||
keycloak_quarkus_hostname: http://instance
|
||||
keycloak_quarkus_hostname: https://instance:8443
|
||||
keycloak_quarkus_log: file
|
||||
keycloak_quarkus_log_level: debug # needed for the verify step
|
||||
keycloak_quarkus_https_key_file_enabled: true
|
||||
|
@ -37,7 +37,7 @@
|
|||
repository_url: https://repo1.maven.org/maven2/ # https://mvnrepository.com/artifact/org.keycloak/keycloak-kerberos-federation/24.0.4
|
||||
group_id: org.keycloak
|
||||
artifact_id: keycloak-kerberos-federation
|
||||
version: 24.0.5 # optional
|
||||
version: 26.0.7 # optional
|
||||
# username: myUser # optional
|
||||
# password: myPAT # optional
|
||||
# - id: my-static-theme
|
||||
|
@ -51,7 +51,10 @@
|
|||
roles:
|
||||
- role: keycloak_quarkus
|
||||
- role: keycloak_realm
|
||||
keycloak_url: "{{ keycloak_quarkus_hostname }}"
|
||||
keycloak_context: ''
|
||||
keycloak_admin_user: "{{ keycloak_quarkus_bootstrap_admin_user }}"
|
||||
keycloak_admin_password: "{{ keycloak_quarkus_bootstrap_admin_password }}"
|
||||
keycloak_client_default_roles:
|
||||
- TestRoleAdmin
|
||||
- TestRoleUser
|
||||
|
|
|
@ -11,6 +11,7 @@ platforms:
|
|||
- "8080/tcp"
|
||||
- "8443/tcp"
|
||||
- "8009/tcp"
|
||||
- "9000/tcp"
|
||||
published_ports:
|
||||
- 0.0.0.0:8443:8443/tcp
|
||||
provisioner:
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
- name: Make sure a jre is available (for keytool to prepare keystore)
|
||||
delegate_to: localhost
|
||||
ansible.builtin.package:
|
||||
name: "{{ 'java-17-openjdk-headless' if hera_home | length > 0 else 'openjdk-17-jdk-headless' }}"
|
||||
name: "{{ 'java-21-openjdk-headless' if hera_home | length > 0 else 'openjdk-21-jdk-headless' }}"
|
||||
state: present
|
||||
become: true
|
||||
failed_when: false
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
- name: Verify
|
||||
hosts: all
|
||||
vars:
|
||||
keycloak_quarkus_bootstrap_admin_user: "remembertochangeme"
|
||||
keycloak_quarkus_bootstrap_admin_password: "remembertochangeme"
|
||||
keycloak_quarkus_bootstrap_admin_user: "remembertochangeme"
|
||||
tasks:
|
||||
- name: Populate service facts
|
||||
ansible.builtin.service_facts:
|
||||
|
@ -35,10 +36,10 @@
|
|||
- name: Verify endpoint URLs
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- (openid_config.stdout | from_json)["backchannel_authentication_endpoint"] == 'https://instance/realms/master/protocol/openid-connect/ext/ciba/auth'
|
||||
- (openid_config.stdout | from_json)['issuer'] == 'https://instance/realms/master'
|
||||
- (openid_config.stdout | from_json)['authorization_endpoint'] == 'https://instance/realms/master/protocol/openid-connect/auth'
|
||||
- (openid_config.stdout | from_json)['token_endpoint'] == 'https://instance/realms/master/protocol/openid-connect/token'
|
||||
- (openid_config.stdout | from_json)["backchannel_authentication_endpoint"] == 'https://instance:8443/realms/master/protocol/openid-connect/ext/ciba/auth'
|
||||
- (openid_config.stdout | from_json)['issuer'] == 'https://instance:8443/realms/master'
|
||||
- (openid_config.stdout | from_json)['authorization_endpoint'] == 'https://instance:8443/realms/master/protocol/openid-connect/auth'
|
||||
- (openid_config.stdout | from_json)['token_endpoint'] == 'https://instance:8443/realms/master/protocol/openid-connect/token'
|
||||
delegate_to: localhost
|
||||
|
||||
- name: Check log folder
|
||||
|
@ -91,7 +92,7 @@
|
|||
ansible.builtin.uri:
|
||||
url: "https://instance:8443/realms/master/protocol/openid-connect/token"
|
||||
method: POST
|
||||
body: "client_id=admin-cli&username=admin&password={{ keycloak_quarkus_bootstrap_admin_user }}&grant_type=password"
|
||||
body: "client_id=admin-cli&username={{ keycloak_quarkus_bootstrap_admin_user }}&password={{ keycloak_quarkus_bootstrap_admin_password}}&grant_type=password"
|
||||
validate_certs: no
|
||||
register: keycloak_auth_response
|
||||
until: keycloak_auth_response.status == 200
|
||||
|
|
|
@ -5,8 +5,7 @@
|
|||
keycloak_quarkus_show_deprecation_warnings: false
|
||||
keycloak_quarkus_bootstrap_admin_password: "remembertochangeme"
|
||||
keycloak_quarkus_bootstrap_admin_user: "remembertochangeme"
|
||||
keycloak_realm: TestRealm
|
||||
keycloak_quarkus_hostname: "http://{{ inventory_hostname }}"
|
||||
keycloak_quarkus_hostname: "http://{{ inventory_hostname }}:8080"
|
||||
keycloak_quarkus_log: file
|
||||
keycloak_quarkus_log_level: info
|
||||
keycloak_quarkus_https_key_file_enabled: true
|
||||
|
|
|
@ -14,6 +14,7 @@ platforms:
|
|||
port_bindings:
|
||||
- "8080/tcp"
|
||||
- "8443/tcp"
|
||||
- "9000/tcp"
|
||||
- name: instance2
|
||||
image: registry.access.redhat.com/ubi9/ubi-init:latest
|
||||
pre_build_image: true
|
||||
|
@ -26,6 +27,7 @@ platforms:
|
|||
port_bindings:
|
||||
- "8080/tcp"
|
||||
- "8443/tcp"
|
||||
- "9000/tcp"
|
||||
- name: postgres
|
||||
image: ubuntu/postgres:14-22.04_beta
|
||||
pre_build_image: true
|
||||
|
|
|
@ -5,6 +5,6 @@
|
|||
- vars.yml
|
||||
vars:
|
||||
keycloak_quarkus_show_deprecation_warnings: false
|
||||
keycloak_quarkus_version: 24.0.3
|
||||
keycloak_quarkus_version: 26.0.7
|
||||
roles:
|
||||
- role: keycloak_quarkus
|
||||
|
|
|
@ -13,8 +13,10 @@ platforms:
|
|||
privileged: true
|
||||
port_bindings:
|
||||
- 8080:8080
|
||||
- "9000/tcp"
|
||||
published_ports:
|
||||
- 0.0.0.0:8080:8080/TCP
|
||||
- 0.0.0.0:9000:9000/TCP
|
||||
provisioner:
|
||||
name: ansible
|
||||
playbooks:
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
- vars.yml
|
||||
vars:
|
||||
sudo_pkg_name: sudo
|
||||
keycloak_quarkus_version: 23.0.7
|
||||
keycloak_quarkus_version: 24.0.5
|
||||
pre_tasks:
|
||||
- name: Install sudo
|
||||
ansible.builtin.apt:
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
keycloak_quarkus_offline_install: false
|
||||
keycloak_quarkus_bootstrap_admin_password: "remembertochangeme"
|
||||
keycloak_quarkus_realm: TestRealm
|
||||
keycloak_quarkus_hostname: http://instance
|
||||
keycloak_quarkus_hostname: http://instance:8080
|
||||
keycloak_quarkus_log: file
|
||||
keycloak_quarkus_https_key_file_enabled: true
|
||||
keycloak_quarkus_log_target: /tmp/keycloak
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
- name: Verify we are running on requested jvm
|
||||
ansible.builtin.shell: |
|
||||
set -eo pipefail
|
||||
ps -ef | grep 'etc/alternatives/.*17' | grep -v grep
|
||||
ps -ef | grep 'etc/alternatives/.*21' | grep -v grep
|
||||
changed_when: false
|
||||
|
||||
- name: Verify token api call
|
||||
|
|
|
@ -59,7 +59,7 @@ Role Defaults
|
|||
|`keycloak_quarkus_service_restart_always`| systemd restart always behavior activation | `False` |
|
||||
|`keycloak_quarkus_service_restart_on_failure`| systemd restart on-failure behavior activation | `False` |
|
||||
|`keycloak_quarkus_service_restartsec`| systemd RestartSec | `10s` |
|
||||
|`keycloak_quarkus_jvm_package`| RHEL java package runtime | `java-17-openjdk-headless` |
|
||||
|`keycloak_quarkus_jvm_package`| RHEL java package runtime | `java-21-openjdk-headless` |
|
||||
|`keycloak_quarkus_java_home`| JAVA_HOME of installed JRE, leave empty for using specified keycloak_quarkus_jvm_package RPM path | `None` |
|
||||
|`keycloak_quarkus_java_heap_opts`| Heap memory JVM setting | `-Xms1024m -Xmx2048m` |
|
||||
|`keycloak_quarkus_java_jvm_opts`| Other JVM settings | same as keycloak |
|
||||
|
|
|
@ -22,7 +22,7 @@ argument_specs:
|
|||
description: "Perform an offline install"
|
||||
type: "bool"
|
||||
keycloak_quarkus_jvm_package:
|
||||
default: "java-11-openjdk-headless"
|
||||
default: "java-21-openjdk-headless"
|
||||
description: "RHEL java package runtime"
|
||||
type: "str"
|
||||
keycloak_quarkus_java_home:
|
||||
|
@ -479,7 +479,7 @@ argument_specs:
|
|||
downstream:
|
||||
options:
|
||||
rhbk_version:
|
||||
default: "26.0.6"
|
||||
default: "26.0.7"
|
||||
description: "Red Hat Build of Keycloak version"
|
||||
type: "str"
|
||||
rhbk_archive:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
keycloak_quarkus_varjvm_package: "{{ keycloak_quarkus_jvm_package | default('java-17-openjdk-headless') }}"
|
||||
keycloak_quarkus_varjvm_package: "{{ keycloak_quarkus_jvm_package | default('java-21-openjdk-headless') }}"
|
||||
keycloak_quarkus_prereq_package_list:
|
||||
- "{{ keycloak_quarkus_varjvm_package }}"
|
||||
- unzip
|
||||
|
|
Loading…
Add table
Reference in a new issue