mirror of
https://github.com/ansible-middleware/keycloak.git
synced 2025-07-28 07:31:30 -07:00
Add custom xml parameter and test scenario
This commit is contained in:
parent
548db6fc4b
commit
0751b97b87
15 changed files with 751 additions and 9 deletions
|
@ -99,6 +99,7 @@ Role Defaults
|
|||
|`keycloak_jboss_home` | Installation work directory | `{{ keycloak_rhsso_installdir if keycloak_rhsso_enable else keycloak_installdir }}` |
|
||||
|`keycloak_config_dir` | Path for configuration | `{{ keycloak_jboss_home }}/standalone/configuration` |
|
||||
|`keycloak_config_path_to_standalone_xml` | Custom path for configuration | `{{ keycloak_jboss_home }}/standalone/configuration/{{ keycloak_config_standalone_xml }}` |
|
||||
|`keycloak_config_override_template` | Path to custom template for standalone.xml configuration | `''` |
|
||||
|`keycloak_auth_realm` | Name for rest authentication realm | `master` |
|
||||
|`keycloak_auth_client` | Authentication client for configuration REST calls | `admin-cli` |
|
||||
|`keycloak_force_install` | Remove pre-existing versions of service | `False` |
|
||||
|
|
|
@ -27,6 +27,7 @@ keycloak_jboss_home: "{{ keycloak_rhsso_installdir if keycloak_rhsso_enable else
|
|||
keycloak_config_dir: "{{ keycloak_jboss_home }}/standalone/configuration"
|
||||
keycloak_config_standalone_xml: "keycloak.xml"
|
||||
keycloak_config_path_to_standalone_xml: "{{ keycloak_jboss_home }}/standalone/configuration/{{ keycloak_config_standalone_xml }}"
|
||||
keycloak_config_override_template: ''
|
||||
keycloak_service_user: keycloak
|
||||
keycloak_service_group: keycloak
|
||||
keycloak_service_pidfile: "/run/keycloak.pid"
|
||||
|
|
|
@ -106,6 +106,11 @@ argument_specs:
|
|||
default: "{{ keycloak_jboss_home }}/standalone/configuration/{{ keycloak_config_standalone_xml }}"
|
||||
description: "Custom path for configuration"
|
||||
type: "str"
|
||||
keycloak_config_override_template:
|
||||
# line 30 of keycloak/defaults/main.yml
|
||||
default: ""
|
||||
description: "Path to custom template for standalone.xml configuration"
|
||||
type: "str"
|
||||
keycloak_service_user:
|
||||
# line 29 of keycloak/defaults/main.yml
|
||||
default: "keycloak"
|
||||
|
|
|
@ -181,17 +181,17 @@
|
|||
jdbc_driver_module_name: "{{ keycloak_jdbc[keycloak_jdbc_engine].driver_module_name }}"
|
||||
when: keycloak_jdbc[keycloak_jdbc_engine].enabled
|
||||
|
||||
- name: "Deploy {{ keycloak.service_name }} config to {{ keycloak_config_path_to_standalone_xml }}"
|
||||
- name: "Deploy {{ keycloak.service_name }} config to {{ keycloak_config_path_to_standalone_xml }} from {{ keycloak.config_template_source }}"
|
||||
become: yes
|
||||
ansible.builtin.template:
|
||||
src: templates/standalone.xml.j2
|
||||
src: "templates/{{ keycloak.config_template_source }}"
|
||||
dest: "{{ keycloak_config_path_to_standalone_xml }}"
|
||||
owner: "{{ keycloak_service_user }}"
|
||||
group: "{{ keycloak_service_group }}"
|
||||
mode: 0640
|
||||
notify:
|
||||
- restart keycloak
|
||||
when: not keycloak_remotecache.enabled
|
||||
when: not keycloak_remotecache.enabled or keycloak_config_override_template|length > 0
|
||||
|
||||
- name: "Deploy {{ keycloak.service_name }} config with remote cache store to {{ keycloak_config_path_to_standalone_xml }}"
|
||||
become: yes
|
||||
|
|
|
@ -20,6 +20,7 @@ keycloak:
|
|||
service_name: "{{ 'rhsso' if keycloak_rhsso_enable else 'keycloak' }}"
|
||||
health_url: "{{ keycloak_management_url }}/health"
|
||||
cli_path: "{{ keycloak_jboss_home }}/bin/jboss-cli.sh"
|
||||
config_template_source: "{{ keycloak_config_override_template if keycloak_config_override_template | length > 0 else 'standalone.xml.j2' }}"
|
||||
|
||||
# database
|
||||
keycloak_jdbc:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue