Go to file
Guido Grazioli 5e89139870
Downstream variables
2022-09-19 17:11:56 +02:00
.github ci: linter, workflows, galaxy, molecule 2022-09-19 15:41:12 +02:00
changelogs Update changelog for release 1.0.7 2022-07-06 12:10:08 +00:00
docs keycloak_quarkus: add selected java to PATH in systemd unit (#34) 2022-05-31 03:43:55 -05:00
meta Bump to 1.0.5, add EE setup ref 2022-05-19 09:38:47 +02:00
molecule ci: linter, workflows, galaxy, molecule 2022-09-19 15:41:12 +02:00
playbooks Downstream variables 2022-09-19 17:11:56 +02:00
roles Downstream variables 2022-09-19 17:11:56 +02:00
.ansible-lint ci: linter, workflows, galaxy, molecule 2022-09-19 15:41:12 +02:00
.gitignore keycloak_quarkus: add https to molecule test setup (#36) 2022-05-31 12:07:18 -05:00
.yamllint Fix linter warnings 2021-12-14 11:34:41 +01:00
CHANGELOG.rst Update changelog for release 1.0.7 2022-07-06 12:10:08 +00:00
CONTRIBUTING.md docs: add testing and releasing contributor pages 2022-03-11 15:15:18 +01:00
LICENSE Initial commit 2021-12-14 09:54:49 +01:00
README.md Downstream variables 2022-09-19 17:11:56 +02:00
bindep.txt Bump to 1.0.5, add EE setup ref 2022-05-19 09:38:47 +02:00
galaxy.yml ci: linter, workflows, galaxy, molecule 2022-09-19 15:41:12 +02:00
requirements.txt rework docs, add python requirements 2022-01-27 15:38:03 +01:00
requirements.yml chore: update dep on jcliff -> wildfly 2022-02-08 15:15:27 +01:00

README.md

Ansible Collection - middleware_automation.keycloak

Build Status

Collection to install and configure Keycloak or Red Hat Single Sign-On.

Ansible version compatibility

This collection has been tested against following Ansible versions: >=2.9.10.

Plugins and modules within a collection may be tested with only specific Ansible versions. A collection may contain metadata that identifies these versions.

Installation

Installing the Collection from Ansible Galaxy

Before using the collection, you need to install it with the Ansible Galaxy CLI:

ansible-galaxy collection install middleware_automation.keycloak

You can also include it in a requirements.yml file and install it via ansible-galaxy collection install -r requirements.yml, using the format:

---
collections:
  - name: middleware_automation.keycloak

The keycloak collection also depends on the following python packages to be present on the controller host:

  • netaddr

A requirement file is provided to install:

pip install -r requirements.txt

Included roles

  • keycloak: role for installing the service.
  • keycloak_realm: role for configuring a realm, user federation(s), clients and users, in an installed service.
  • keycloak_quarkus: role for installing the quarkus variant of keycloak (>= 17.0.0).

Usage

Install Playbook

Both playbooks include the keycloak role, with different settings, as described in the following sections.

For full service configuration details, refer to the keycloak role README.

Install from controller node (local source)

Making the keycloak zip archive (or the RHSSO zip archive), available to the playbook repository root directory, and setting keycloak_offline_install to True, allows to skip the download tasks. The local path for the archive matches the downloaded archive path, so it is also used as a cache when multiple hosts are provisioned in a cluster.

keycloak_offline_install: True

And depending on keycloak_rhsso_enable:

  • True: install RHSSO using file rh-sso-x.y.z-server-dist.zip
  • False: install keycloak using file keycloak-x.y.zip

Install from alternate sources (like corporate Nexus, artifactory, proxy, etc)

For RHSSO:

sso_download_url: "https://<internal-nexus.private.net>/<path>/<to>/rh-sso-x.y.z-server-dist.zip"

For keycloak:

keycloak_download_url: "https://<internal-nexus.private.net>/<path>/<to>/keycloak-x.y.zip"

Example installation command

Execute the following command from the source root directory

ansible-playbook -i <ansible_hosts> -e @rhn-creds.yml playbooks/keycloak.yml -e keycloak_admin_password=<changeme>
  • keycloak_admin_password Password for the administration console user account.

  • ansible_hosts is the inventory, below is an example inventory for deploying to localhost

    [keycloak]
    localhost ansible_connection=local
    

Configuration

Config Playbook

playbooks/keycloak_realm.yml creates or updates provided realm, user federation(s), client(s), client role(s) and client user(s).

Example configuration command

Execute the following command from the source root directory:

ansible-playbook -i <ansible_hosts> playbooks/keycloak_realm.yml -e keycloak_admin_password=<changeme> -e keycloak_realm=test
  • keycloak_admin_password password for the administration console user account.

  • keycloak_realm name of the realm to be created/used.

  • ansible_hosts is the inventory, below is an example inventory for deploying to localhost

    [keycloak]
    localhost ansible_connection=local
    

For full configuration details, refer to the keycloak_realm role README.

Support

Keycloak collection v1.0.0 is a Beta release and for Technical Preview. If you have any issues or questions related to collection, please don't hesitate to contact us on Ansible-middleware-core@redhat.com or open an issue on https://github.com/ansible-middleware/keycloak/issues

License

Apache License v2.0 or later

See LICENSE to view the full text.