Skip to content

Commit

Permalink
validation: add check for jdbc drivers
Browse files Browse the repository at this point in the history
  • Loading branch information
rpelisse committed Apr 22, 2024
1 parent 8bdae95 commit 662bd7e
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 12 deletions.
1 change: 1 addition & 0 deletions molecule/install_options/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
wildfly_user: mware
wildfly_group: sysgroup
wildfly_java_package_name: java-17-openjdk-headless
wildfly_validation_skip_jdbc_drivers_check: false

- name: Validation
hosts: all
Expand Down
14 changes: 2 additions & 12 deletions playbooks/playbook.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
---
- name: Ensure Wildfly is install and running as a service
hosts: all
vars:
# app deployment can be handled throught the following list
# warning: using the yaml_config makes its mandatory to deploy
# through this list
# wildfly_apps:
# - { path: /path/to/war, unmanaged: true }
wildfly_systemd_wait_for_port: true
postgres_driver_version: 9.4.1212
mariadb_driver_version: 3.2.0
jdbc_drivers:
- { version: "{{ postgres_driver_version }}", name: 'org.postgresql', jar_file: "postgresql-{{ postgres_driver_version }}.jar", url: "https://repo.maven.apache.org/maven2/org/postgresql/postgresql/{{ postgres_driver_version }}/postgresql-{{ postgres_driver_version }}.jar" }
- { version: "{{ mariadb_driver_version }}", name: 'org.mariadb', jar_file: "mariadb-java-client-{{ mariadb_driver_version }}.jar", url: "https://repo1.maven.org/maven2/org/mariadb/jdbc/mariadb-java-client/{{ mariadb_driver_version }}/mariadb-java-client-{{ mariadb_driver_version }}.jar" }
vars_files:
- vars/vars.yml
roles:
- wildfly_install
- wildfly_systemd
Expand Down
2 changes: 2 additions & 0 deletions playbooks/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
- name: Verify
hosts: all
gather_facts: false
vars_files:
- vars/vars.yml
roles:
- middleware_automation.wildfly.wildfly_validation
12 changes: 12 additions & 0 deletions playbooks/vars/vars.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
# app deployment can be handled throught the following list
# warning: using the yaml_config makes its mandatory to deploy
# through this list
# wildfly_apps:
# - { path: /path/to/war, unmanaged: true }
wildfly_systemd_wait_for_port: true
postgres_driver_version: 9.4.1212
mariadb_driver_version: 3.2.0
jdbc_drivers:
- { version: "{{ postgres_driver_version }}", name: 'org.postgresql', jar_file: "postgresql-{{ postgres_driver_version }}.jar", url: "https://repo.maven.apache.org/maven2/org/postgresql/postgresql/{{ postgres_driver_version }}/postgresql-{{ postgres_driver_version }}.jar" }
- { version: "{{ mariadb_driver_version }}", name: 'org.mariadb', jar_file: "mariadb-java-client-{{ mariadb_driver_version }}.jar", url: "https://repo1.maven.org/maven2/org/mariadb/jdbc/mariadb-java-client/{{ mariadb_driver_version }}/mariadb-java-client-{{ mariadb_driver_version }}.jar" }
9 changes: 9 additions & 0 deletions roles/wildfly_validation/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,12 @@
loop: "{{ wildfly_validation_queries }}"
when:
- not wildfly_validation_skip_config_check is defined

- name: "Verify JDBC drivers deployment (if any)"
ansible.builtin.include_tasks: verify_with_cli_queries.yml
vars:
validation_query: "/core-service=module-loading:list-resource-loader-paths(module={{ item.name }})"
loop: "{{ jdbc_drivers }}"
when:
- not wildfly_validation_skip_jdbc_drivers_check is defined
- jdbc_drivers is defined and jdbc_drivers | length > 0

0 comments on commit 662bd7e

Please sign in to comment.