Break dependency on wildfly/eap

main
Guido Grazioli 2022-09-19 22:07:23 +02:00
parent 9f8b1c6d76
commit 69a8860551
No known key found for this signature in database
GPG Key ID: 22C8C31EF2BC093B
7 changed files with 47 additions and 18 deletions

View File

@ -2,8 +2,6 @@
collections: collections:
- name: middleware_automation.redhat_csp_download - name: middleware_automation.redhat_csp_download
version: ">=1.2.1" version: ">=1.2.1"
- name: middleware_automation.wildfly
version: ">=0.0.5"
- name: community.general - name: community.general
- name: community.docker - name: community.docker
version: ">=1.9.1" version: ">=1.9.1"

View File

@ -2,8 +2,6 @@
collections: collections:
- name: middleware_automation.redhat_csp_download - name: middleware_automation.redhat_csp_download
version: ">=1.2.1" version: ">=1.2.1"
- name: middleware_automation.wildfly
version: ">=0.0.5"
- name: community.general - name: community.general
- name: community.docker - name: community.docker
version: ">=1.9.1" version: ">=1.9.1"

View File

@ -2,8 +2,6 @@
collections: collections:
- name: middleware_automation.redhat_csp_download - name: middleware_automation.redhat_csp_download
version: ">=1.2.1" version: ">=1.2.1"
- name: middleware_automation.wildfly
version: ">=0.0.5"
- name: community.general - name: community.general
- name: community.docker - name: community.docker
version: ">=1.9.1" version: ">=1.9.1"

View File

@ -2,6 +2,4 @@
collections: collections:
- name: middleware_automation.redhat_csp_download - name: middleware_automation.redhat_csp_download
version: ">=1.2.1" version: ">=1.2.1"
- name: middleware_automation.wildfly
version: ">=0.0.5"
- name: community.general - name: community.general

View File

@ -172,16 +172,7 @@
# driver and configuration # driver and configuration
- name: "Install {{ keycloak_jdbc_engine }} driver" - name: "Install {{ keycloak_jdbc_engine }} driver"
ansible.builtin.include_role: ansible.builtin.include_tasks: jdbc_driver.yml
name: middleware_automation.wildfly.wildfly_driver
vars:
wildfly_user: "{{ keycloak_service_user }}"
jdbc_driver_module_dir: "{{ keycloak_jdbc[keycloak_jdbc_engine].driver_module_dir }}"
jdbc_driver_version: "{{ keycloak_jdbc[keycloak_jdbc_engine].driver_version }}"
jdbc_driver_jar_filename: "{{ keycloak_jdbc[keycloak_jdbc_engine].driver_jar_filename }}"
jdbc_driver_jar_url: "{{ keycloak_jdbc[keycloak_jdbc_engine].driver_jar_url }}"
jdbc_driver_jar_installation_path: "{{ keycloak_jdbc[keycloak_jdbc_engine].driver_module_dir }}/{{ keycloak_jdbc[keycloak_jdbc_engine].driver_jar_filename }}"
jdbc_driver_module_name: "{{ keycloak_jdbc[keycloak_jdbc_engine].driver_module_name }}"
when: keycloak_jdbc[keycloak_jdbc_engine].enabled when: keycloak_jdbc[keycloak_jdbc_engine].enabled
- name: "Deploy {{ keycloak.service_name }} config to {{ keycloak_config_path_to_standalone_xml }} from {{ keycloak.config_template_source }}" - name: "Deploy {{ keycloak.service_name }} config to {{ keycloak_config_path_to_standalone_xml }} from {{ keycloak.config_template_source }}"

View File

@ -0,0 +1,36 @@
---
- name: "Check module directory: {{ keycloak_jdbc[keycloak_jdbc_engine].driver_module_dir }}"
ansible.builtin.stat:
path: "{{ keycloak_jdbc[keycloak_jdbc_engine].driver_module_dir }}"
register: dest_path
become: yes
- name: "Set up module dir for JDBC Driver {{ keycloak_jdbc[keycloak_jdbc_engine].driver_module_name }}"
ansible.builtin.file:
path: "{{ keycloak_jdbc[keycloak_jdbc_engine].driver_module_dir }}"
state: directory
recurse: yes
owner: "{{ keycloak_service_user }}"
group: "{{ keycloak_service_group }}"
mode: 0750
become: yes
when:
- not dest_path.stat.exists
- name: "Retrieve JDBC Driver from {{ keycloak_jdbc[keycloak_jdbc_engine].driver_jar_url }}"
ansible.builtin.uri:
url: "{{ keycloak_jdbc[keycloak_jdbc_engine].driver_jar_url }}"
dest: "{{ keycloak_jdbc[keycloak_jdbc_engine].driver_module_dir }}/{{ keycloak_jdbc[keycloak_jdbc_engine].driver_jar_filename }}"
group: "{{ keycloak_service_group }}"
owner: "{{ keycloak_service_user }}"
mode: 0640
become: yes
- name: "Deploy module.xml for JDBC Driver"
ansible.builtin.template:
src: "templates/jdbc_driver_module.xml.j2"
dest: "{{ keycloak_jdbc[keycloak_jdbc_engine].driver_module_dir }}/module.xml"
group: "{{ keycloak_service_group }}"
owner: "{{ keycloak_service_user }}"
mode: 0640
become: yes

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="{{ keycloak_jdbc[keycloak_jdbc_engine].driver_module_name }}">
<resources>
<resource-root path="{{ keycloak_jdbc[keycloak_jdbc_engine].driver_jar_filename }}"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>