Refactored applications.keycloak* variables

This commit is contained in:
Kevin Veen-Birkenbach 2025-02-15 16:24:31 +01:00
parent 0b98bc1541
commit c7da4ddd8f
4 changed files with 5 additions and 28 deletions

View File

@ -71,6 +71,9 @@ defaults_applications:
keycloak: keycloak:
version: "latest" version: "latest"
administrator_username: "{{administrator_username}}" # Administrator Username for Keycloak administrator_username: "{{administrator_username}}" # Administrator Username for Keycloak
# database_password: # Needs to be defined in inventory file
# administrator_password: # Needs to be defined in inventory file
## LDAP ## LDAP
ldap: ldap:

View File

@ -17,32 +17,6 @@ The role integrates Keycloak with PostgreSQL as a database and supports operatio
- Docker and Docker Compose must be installed on the target system. - Docker and Docker Compose must be installed on the target system.
- A working NGINX proxy for forwarding requests to Keycloak (optional). - A working NGINX proxy for forwarding requests to Keycloak (optional).
## Variables ⚙️
### Main Variables
Defined in `vars/main.yml`:
| Variable | Description |
|---------------------------------|------------------------------------------------------------------|
| `application_id` | Name of the Docker Compose project. Default: `keycloak`. |
| `database_type` | Type of the database. Default: `postgres`. |
| `database_password` | Password for the PostgreSQL database user. |
### Additional Variables (Templates)
| Variable | Description |
|---------------------------------|------------------------------------------------------------------|
| `applications.keycloak.version` | Version of the Keycloak image. |
| `domain` | Domain where Keycloak will be accessible. |
| `applications.keycloak.administrator_username` | Admin username for Keycloak. |
| `keycloak_administrator_password` | Admin password for Keycloak. |
| `database_host` | Host of the PostgreSQL database. |
| `database_name` | Name of the PostgreSQL database. |
| `database_username` | Username for the PostgreSQL database. |
| `http_port` | Port where Keycloak will be accessible (default: `8080`). |
| `docker_restart_policy` | Docker restart policy (e.g., `always`, `unless-stopped`). |
## Tasks 🛠️ ## Tasks 🛠️
The role performs the following main tasks: The role performs the following main tasks:

View File

@ -2,7 +2,7 @@ KC_HOSTNAME= https://{{domain}}
KC_HTTP_ENABLED= true KC_HTTP_ENABLED= true
KC_HEALTH_ENABLED= true KC_HEALTH_ENABLED= true
KEYCLOAK_ADMIN= "{{applications.keycloak.administrator_username}}" KEYCLOAK_ADMIN= "{{applications.keycloak.administrator_username}}"
KEYCLOAK_ADMIN_PASSWORD= "{{keycloak_administrator_password}}" KEYCLOAK_ADMIN_PASSWORD= "{{applications.keycloak.administrator_password}}"
KC_DB= postgres KC_DB= postgres
KC_DB_URL= jdbc:postgresql://{{database_host}}/{{database_name}} KC_DB_URL= jdbc:postgresql://{{database_host}}/{{database_name}}
KC_DB_USERNAME= {{database_username}} KC_DB_USERNAME= {{database_username}}

View File

@ -1,4 +1,4 @@
application_id: "keycloak" application_id: "keycloak"
database_type: "postgres" database_type: "postgres"
database_password: "{{keycloak_database_password}}" database_password: "{{applications.keycloak.database_password}}"
ldap_enabled: True ldap_enabled: True