mirror of
https://github.com/ansible-middleware/keycloak.git
synced 2025-04-06 10:50:31 -07:00
fix/147: keycloak_quarkus: RBKC: Add support for sqlserver jdbc driver
This commit is contained in:
parent
e086ee8d29
commit
bfd9db6703
5 changed files with 24 additions and 3 deletions
|
@ -55,7 +55,7 @@ Role Defaults
|
||||||
|
|
||||||
| Variable | Description | Default |
|
| Variable | Description | Default |
|
||||||
|:---------|:------------|:--------|
|
|:---------|:------------|:--------|
|
||||||
|`keycloak_quarkus_jdbc_engine` | Database engine [mariadb,postres] | `postgres` |
|
|`keycloak_quarkus_jdbc_engine` | Database engine [mariadb,postres,mssql] | `postgres` |
|
||||||
|`keycloak_quarkus_db_user` | User for database connection | `keycloak-user` |
|
|`keycloak_quarkus_db_user` | User for database connection | `keycloak-user` |
|
||||||
|`keycloak_quarkus_db_pass` | Password for database connection | `keycloak-pass` |
|
|`keycloak_quarkus_db_pass` | Password for database connection | `keycloak-pass` |
|
||||||
|`keycloak_quarkus_jdbc_url` | JDBC URL for connecting to database | `jdbc:postgresql://localhost:5432/keycloak` |
|
|`keycloak_quarkus_jdbc_url` | JDBC URL for connecting to database | `jdbc:postgresql://localhost:5432/keycloak` |
|
||||||
|
|
|
@ -97,7 +97,10 @@ keycloak_quarkus_default_jdbc:
|
||||||
mariadb:
|
mariadb:
|
||||||
url: 'jdbc:mariadb://localhost:3306/keycloak'
|
url: 'jdbc:mariadb://localhost:3306/keycloak'
|
||||||
version: 2.7.4
|
version: 2.7.4
|
||||||
|
mssql:
|
||||||
|
url: 'jdbc:sqlserver://localhost:1433;databaseName=keycloak;'
|
||||||
|
version: 12.2.0
|
||||||
|
driver_jar_url: "https://repo1.maven.org/maven2/com/microsoft/sqlserver/mssql-jdbc/12.2.0.jre11/mssql-jdbc-12.2.0.jre11.jar" # cf. https://access.redhat.com/documentation/en-us/red_hat_build_of_keycloak/22.0/html/server_guide/db-#db-installing-the-microsoft-sql-server-driver
|
||||||
### logging configuration
|
### logging configuration
|
||||||
keycloak_quarkus_log: file
|
keycloak_quarkus_log: file
|
||||||
keycloak_quarkus_log_level: info
|
keycloak_quarkus_log_level: info
|
||||||
|
|
|
@ -234,7 +234,7 @@ argument_specs:
|
||||||
keycloak_quarkus_jdbc_engine:
|
keycloak_quarkus_jdbc_engine:
|
||||||
# line 56 of defaults/main.yml
|
# line 56 of defaults/main.yml
|
||||||
default: "postgres"
|
default: "postgres"
|
||||||
description: "Database engine [mariadb,postres]"
|
description: "Database engine [mariadb,postres,mssql]"
|
||||||
type: "str"
|
type: "str"
|
||||||
keycloak_quarkus_db_user:
|
keycloak_quarkus_db_user:
|
||||||
# line 58 of defaults/main.yml
|
# line 58 of defaults/main.yml
|
||||||
|
|
|
@ -109,3 +109,9 @@
|
||||||
msg: "{{ keycloak.home }} already exists and version unchanged, skipping decompression"
|
msg: "{{ keycloak.home }} already exists and version unchanged, skipping decompression"
|
||||||
when:
|
when:
|
||||||
- (not new_version_downloaded.changed) and path_to_workdir.stat.exists
|
- (not new_version_downloaded.changed) and path_to_workdir.stat.exists
|
||||||
|
|
||||||
|
- name: "Install {{ keycloak_quarkus_jdbc_engine }} JDBC driver"
|
||||||
|
ansible.builtin.include_tasks: jdbc_driver.yml
|
||||||
|
when:
|
||||||
|
- rhbk_enable is defined and rhbk_enable
|
||||||
|
- keycloak_quarkus_default_jdbc[keycloak_quarkus_jdbc_engine].driver_jar_url is defined
|
||||||
|
|
12
roles/keycloak_quarkus/tasks/jdbc_driver.yml
Normal file
12
roles/keycloak_quarkus/tasks/jdbc_driver.yml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
- name: "Retrieve JDBC Driver from {{ keycloak_jdbc[keycloak_quarkus_jdbc_engine].driver_jar_url }}"
|
||||||
|
ansible.builtin.get_url:
|
||||||
|
url: "{{ keycloak_quarkus_default_jdbc[keycloak_quarkus_jdbc_engine].driver_jar_url }}"
|
||||||
|
dest: "{{ keycloak.home }}/providers"
|
||||||
|
owner: "{{ keycloak.service_user }}"
|
||||||
|
group: "{{ keycloak.service_group }}"
|
||||||
|
mode: 0640
|
||||||
|
become: true
|
||||||
|
notify:
|
||||||
|
- restart keycloak
|
Loading…
Add table
Reference in a new issue