keycloak
Install keycloak or Red Hat Single Sign-On server configurations.
Requirements
This role requires the python3-netaddr
library installed on the controller node.
to install via yum/dnf:
dnf install python3-netaddr
or via pip:
pip install netaddr==0.8.0
or via the collection:
pip install -r requirements.txt
Dependencies
The roles depends on:
the
redhat_csp_download
role from middleware_automation.redhat_csp_download collection if Red Hat Single Sign-on zip have to be downloaded from RHN.the
wildfly_driver
role from middleware_automation.wildfly collection
Versions
RH-SSO VERSION |
Release Date |
Keycloak Version |
EAP Version |
Notes |
---|---|---|---|---|
|
September 20, 2021 |
|
|
Patching
When variable keycloak_rhsso_apply_patches
is True
(default: False
), the role will automatically apply the latest cumulative patch for the selected base version.
RH-SSO VERSION |
Release Date |
RH-SSO LATEST CP |
Notes |
---|---|---|---|
|
January 20, 2022 |
|
Role Defaults
Service configuration
Variable |
Description |
Default |
---|---|---|
|
Enable auto configuration for database backend, clustering and remote caches on infinispan |
|
|
Enable auto configuration for database backend |
|
|
Administration console user account |
|
|
Address for binding service ports |
|
|
hostname |
|
|
HTTP port |
|
|
TLS HTTP port |
|
|
AJP port |
|
|
jgroups cluster tcp port |
|
|
Management port |
|
|
TLS management port |
|
|
Prefer IPv4 stack and addresses for port binding |
|
|
filename for configuration |
|
|
posix account username |
|
|
posix account group |
|
|
pid file path for service |
|
|
RHEL java package runtime |
|
|
JAVA_HOME of installed JRE, leave empty for using specified keycloak_jvm_package RPM path |
|
|
Additional JVM options |
|
Install options
Variable |
Description |
Default |
---|---|---|
|
Enable Red Hat Single Sign-on installation |
|
|
perform an offline install |
|
|
Download URL for keycloak |
|
|
Download URL for RHSSO |
|
|
keycloak.org package version |
|
|
RHSSO version |
|
|
Install RHSSO more recent cumulative patch |
|
|
Installation root path |
|
|
Download URL for keycloak |
|
|
Base download URI for customer portal |
|
|
Ensure firewalld is running and configure keycloak ports |
|
Miscellaneous configuration
Variable |
Description |
Default |
---|---|---|
|
keycloak install archive filename |
|
|
Download URL for keycloak (deprecated) |
|
|
Installation path |
|
|
Red Hat SSO install archive filename |
|
|
Installation path for Red Hat SSO |
`{{ keycloak_dest }}/rh-sso-{{ keycloak_rhsso_version |
|
Full download URI for Red Hat SSO |
|
|
Installation work directory |
|
|
Path for configuration |
|
|
Custom path for configuration |
|
|
Path to custom template for standalone.xml configuration |
|
|
Name for rest authentication realm |
|
|
Authentication client for configuration REST calls |
|
|
Remove pre-existing versions of service |
|
|
URL for configuration rest calls |
|
|
URL for management console rest calls |
|
|
Customer Portal product ID for Red Hat SSO |
|
Role Variables
The following are a set of required variables for the role:
Variable |
Description |
---|---|
|
Password for the administration console user account (minimum 12 characters) |
|
frontend URL for keycloak endpoint |
The following variables are required only when keycloak_ha_enabled
is True:
Variable |
Description |
Default |
---|---|---|
|
URL for the modcluster reverse proxy |
|
|
backend database engine when db is enabled: [ postgres, mariadb ] |
|
|
URL for the infinispan remote-cache server |
|
|
username for connecting to infinispan |
|
|
password for connecting to infinispan |
|
|
Authentication type |
|
|
Enable hotrod TLS communication |
|
|
Path to truststore with infinispan server certificate |
|
|
Password for opening truststore |
|
The following variables are required only when keycloak_db_enabled
is True:
Variable |
Description |
Default |
---|---|---|
|
URL for the postgres backend database |
|
|
Version for the JDBC driver to download |
|
|
username for connecting to postgres |
|
|
password for connecting to postgres |
|
Example Playbooks
NOTE: use ansible vaults or other security systems for storing credentials.
The following is an example playbook that makes use of the role to install keycloak from remote:
---
- hosts: ...
vars:
keycloak_admin_password: "remembertochangeme"
collections:
- middleware_automation.keycloak
roles:
- middleware_automation.keycloak.keycloak
The following is an example playbook that makes use of the role to install Red Hat Single Sign-On from RHN:
---
- name: Playbook for RHSSO
hosts: keycloak
collections:
- middleware_automation.redhat_csp_download
roles:
- redhat_csp_download
tasks:
- name: Keycloak Role
include_role:
name: keycloak
vars:
keycloak_admin_password: "remembertochangeme"
keycloak_rhsso_enable: True
rhn_username: '<customer portal username>'
rhn_password: '<customer portal password>'
The following example playbook makes use of the role to install keycloak from the controller node:
---
- hosts: ...
collections:
- middleware_automation.keycloak
tasks:
- name: Include keycloak role
include_role:
name: keycloak
vars:
keycloak_admin_password: "remembertochangeme"
keycloak_offline_install: True
# This should be the filename of keycloak archive on Ansible node: keycloak-16.1.0.zip
This playbook installs Red Hat Single Sign-On from an alternate url:
---
- hosts: keycloak
collections:
- middleware_automation.keycloak
tasks:
- name: Keycloak Role
include_role:
name: keycloak
vars:
keycloak_admin_password: "remembertochangeme"
keycloak_rhsso_enable: True
keycloak_rhsso_download_url: "<REPLACE with download url>"
# This should be the full of remote source rhsso zip file and can contain basic authentication credentials
The following is an example playbook that makes use of the role to install Red Hat Single Sign-On offline from the controller node, and apply latest cumulative patch:
---
- hosts: keycloak
collections:
- middleware_automation.keycloak
tasks:
- name: Keycloak Role
include_role:
name: keycloak
vars:
keycloak_admin_password: "remembertochangeme"
keycloak_rhsso_enable: True
keycloak_offline_install: True
keycloak_rhsso_apply_patches: True
# This should be the filename of rhsso zip file on Ansible node: rh-sso-7.5-server-dist.zip
License
Apache License 2.0