mirror of
https://github.com/ansible-middleware/keycloak.git
synced 2025-04-06 10:50:31 -07:00
Merge pull request #202 from InfoSec812/Issue_200-_-customize-jdbc-driver-downloads
Customize jdbc driver downloads, optional authentication
This commit is contained in:
commit
41cbcc41e8
2 changed files with 20 additions and 2 deletions
|
@ -376,6 +376,15 @@ argument_specs:
|
||||||
description: "List of provider definition dicts: { 'id': str, 'spi': str, 'url': str, 'default': bool, 'properties': list of key/value }"
|
description: "List of provider definition dicts: { 'id': str, 'spi': str, 'url': str, 'default': bool, 'properties': list of key/value }"
|
||||||
default: []
|
default: []
|
||||||
type: "list"
|
type: "list"
|
||||||
|
keycloak_quarkus_jdbc_download_url:
|
||||||
|
description: "Override the default Maven Central download URL for the JDBC driver"
|
||||||
|
type: "str"
|
||||||
|
keycloak_quarkus_jdbc_download_user:
|
||||||
|
description: "Set a username with which to authenticate when downloading JDBC drivers from an alternative location"
|
||||||
|
type: "str"
|
||||||
|
keycloak_quarkus_jdbc_download_pass:
|
||||||
|
description: "Set a password with which to authenticate when downloading JDBC drivers from an alternative location (requires keycloak_quarkus_jdbc_download_user)"
|
||||||
|
type: "str"
|
||||||
downstream:
|
downstream:
|
||||||
options:
|
options:
|
||||||
rhbk_version:
|
rhbk_version:
|
||||||
|
|
|
@ -1,10 +1,19 @@
|
||||||
---
|
---
|
||||||
- name: "Retrieve JDBC Driver from {{ keycloak_jdbc[keycloak_quarkus_jdbc_engine].driver_jar_url }}"
|
- name: "Verify valid parameters for download credentials when specified"
|
||||||
|
ansible.builtin.fail:
|
||||||
|
msg: >-
|
||||||
|
When JDBC driver download credentials are set, both the username and the password MUST be set
|
||||||
|
when:
|
||||||
|
- keycloak_jdbc_download_user is undefined and keycloak_jdbc_download_pass is not undefined
|
||||||
|
- keycloak_jdbc_download_pass is undefined and keycloak_jdbc_download_user is not undefined
|
||||||
|
- name: "Retrieve JDBC Driver from {{ keycloak_jdbc_download_user | default(keycloak_quarkus_default_jdbc[keycloak_quarkus_jdbc_engine].driver_jar_url) }}"
|
||||||
ansible.builtin.get_url:
|
ansible.builtin.get_url:
|
||||||
url: "{{ keycloak_quarkus_default_jdbc[keycloak_quarkus_jdbc_engine].driver_jar_url }}"
|
url: "{{ keycloak_jdbc_download_url | default(keycloak_quarkus_default_jdbc[keycloak_quarkus_jdbc_engine].driver_jar_url) }}"
|
||||||
dest: "{{ keycloak.home }}/providers"
|
dest: "{{ keycloak.home }}/providers"
|
||||||
owner: "{{ keycloak.service_user }}"
|
owner: "{{ keycloak.service_user }}"
|
||||||
group: "{{ keycloak.service_group }}"
|
group: "{{ keycloak.service_group }}"
|
||||||
|
url_username: "{{ keycloak_jdbc_download_user | default(omit) }}"
|
||||||
|
url_password: "{{ keycloak_jdbc_download_pass | default(omit) }}"
|
||||||
mode: '0640'
|
mode: '0640'
|
||||||
become: true
|
become: true
|
||||||
notify:
|
notify:
|
||||||
|
|
Loading…
Add table
Reference in a new issue