ansible-role-keycloak/tasks/keycloak-jdbc.yml

17 lines
937 B
YAML

---
- name: Manage the keycloak external DB driver
block:
- name: Create the path to the DB driver
file: dest={{ keycloak_install_dir }}/{{ keycloak_distribution }}/modules/system/layers/base/{{ keycloak_db_module_path }}/main state=directory
- name: Get the JDBC driver {{ keycloack_jdbc_driver }}
get_url: url={{ keycloak_jdbc_driver_url }} dest={{ keycloak_install_dir }}/{{ keycloak_distribution }}/modules/system/layers/base/{{ keycloak_db_module_path }}/main/{{ keycloak_jdbc_driver }} owner=root group=root mode=0444
notify: Restart Keycloak
- name: Install the JDBC module configuration
template: src=jdbc-module.xml.j2 dest={{ keycloak_install_dir }}/{{ keycloak_distribution }}/modules/system/layers/base/{{ keycloak_db_module_path }}/main/module.xml owner=root group=root mode=0444
notify: Restart Keycloak
when: keycloak_use_external_db
tags: [ 'keycloak', 'keycloak_db', 'keycloak_conf' ]