#188: fail early when no keytool installed

This commit is contained in:
Helmut Wolf 2024-04-17 14:33:37 +02:00
parent 0ee29eb483
commit c38642e0cd
2 changed files with 14 additions and 12 deletions

View file

@ -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:

View file

@ -42,3 +42,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"