Skip to content

Commit

Permalink
#188: fail early when no keytool installed
Browse files Browse the repository at this point in the history
  • Loading branch information
hwo-wd committed Apr 17, 2024
1 parent 0dd86bb commit ea203ef
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
12 changes: 0 additions & 12 deletions roles/keycloak_quarkus/tasks/config_store.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
---
- name: "Check if keytool exists in path"
block:
- name: "Attempt to run keytool"
ansible.builtin.command: keytool -help
register: keytool_check
ignore_errors: true

- name: "Fail when no keytool found"
when: keytool_check.rc != 0
ansible.builtin.fail:
msg: "keytool NOT found in the PATH, but is required for setting up the configuration key store"

- name: "Initialize configuration key store variables to be written"
ansible.builtin.set_fact:
store_items:
Expand Down
14 changes: 14 additions & 0 deletions roles/keycloak_quarkus/tasks/prereqs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,17 @@
ansible.builtin.include_tasks: fastpackages.yml
vars:
packages_list: "{{ keycloak_quarkus_prereq_package_list }}"

- name: "Validate keytool"
when: keycloak.config_key_store_enabled
block:
- name: "Attempt to run keytool"
changed_when: false
ansible.builtin.command: keytool -help
register: keytool_check
ignore_errors: true

- name: "Fail when no keytool found"
when: keytool_check.rc != 0
ansible.builtin.fail:
msg: "keytool NOT found in the PATH, but is required for setting up the configuration key store"

0 comments on commit ea203ef

Please sign in to comment.