2021-12-14 10:26:42 +00:00
---
2022-01-04 15:01:37 +00:00
- name : Validate configuration
2021-12-17 13:56:28 +00:00
assert :
that :
- (keycloak_ha_enabled and keycloak_db_enabled) or (not keycloak_ha_enabled and keycloak_db_enabled) or (not keycloak_ha_enabled and not keycloak_db_enabled)
quiet : True
2021-12-20 14:55:05 +00:00
fail_msg : "Cannot install HA setup without a backend database service. Check keycloak_ha_enabled and keycloak_db_enabled"
2021-12-17 13:56:28 +00:00
success_msg : "{{ 'Configuring HA' if keycloak_ha_enabled else 'Configuring standalone' }}"
2022-01-04 15:01:37 +00:00
- name : Validate credentials
2021-12-17 13:56:28 +00:00
assert :
that :
- (rhn_username is defined and rhsso_rhn_id is defined) or rhsso_rhn_id is not defined
- (rhn_password is defined and rhsso_rhn_id is defined) or rhsso_rhn_id is not defined
quiet : True
fail_msg : "Cannot install Red Hat SSO without RHN credentials. Check rhn_username and rhn_password are defined"
success_msg : "{{ 'Installing Red Hat Single Sign-On' if rhsso_rhn_id is defined else 'Installing keycloak.org' }}"
2022-01-04 15:01:37 +00:00
- name : Set required packages facts
set_fact :
2021-12-14 10:26:42 +00:00
required_packages :
2022-01-04 15:01:37 +00:00
- "{{ jvm_package }}"
2021-12-14 10:26:42 +00:00
- unzip
- procps-ng
- initscripts
2022-01-04 15:01:37 +00:00
- name : Ensures required packages are installed
2021-12-14 10:26:42 +00:00
ansible.builtin.include_tasks : fastpackages/install.yml
vars :
packages_list : "{{ required_packages }}"